Git Product home page Git Product logo

grug-bot's Introduction

Grug


GOAL

Become the best guild bot that ever threw rocks.


Contributing

Getting started

  1. Create a Discord App (bot) to test updates in your server.
  2. Visit the 'OAuth2' tab of the Discord Developer Portal and check the 'applications.commands' scope. Copy the generated URL and visit it to grant permissions to your bot.
  3. (optional) Request a Twitter Developer Account (with Elevated Access, then create a Twitter Developer App (make sure you change it to have both read/write permissions).
  4. (optional) Install Twurl and, using your Twitter Developer consumer key & secret, generate the access token & access secret.

Environment Setup

Edit example.env with the following environment variables:

  • DISCORD_TOKEN: A discord bot token created via the app's "Bot -> Build-a-bot" menu.
  • DISCORD_CLIENT_ID: A discord bot client ID created via the app's "OAuth2" menu.
  • DISCORD_GUILD_ID: A discord bot guild ID found via enabling Developer Mode.
  • CONSUMER_KEY - Your Twitter Developer App's Consumer Key
  • CONSUMER_SECRET - Your Twitter Developer App's Consumer Secret
  • ACCESS_TOKEN_KEY - The Access Token Key of the Twitter Account your bot is posting from
  • ACCESS_TOKEN_SECRET - The Access Token Secret of the Twitter Account your bot is posting from
  • REALMS_CONTRACT_ADDRESS - The Ethereum address for the Realms contract. For example 0x7afe30cb3e53dba6801aa0ea647a0ecea7cbe18d is the Mainnet contract address.

Running the bot

yarn && yarn start

How to make changes

Discord

Adding a slash command:

  1. Create new file in /app/services/discord/commands
  2. Copy existing contents from another command (e.g. GA)
  3. Add a name to the function in the exports
  4. Include what you would like to return
  5. Add a graphql query to /app/services/utils/graphql/index.ts
  6. Run locally and test on your own server

TODO:

  • Add subscriptions to listen to indexer and publish updates to discord.
  • Add more utility functions for the Realms, Crypts, Lootverse in general

FAQ

Q: "I tried running my bot but get a 'Missing Access 50001' error"

A: This means that your application doesn't have permission for the discord server in question.

First, make sure you've granted the bot the applications.commands OAuth2 scope Docs and visited the URL under the 'OAuth2' tab in the Discord developer dashboard for your bot.

Second, double check that your DISCORD_GUILD_ID is set for the correct channel.

grug-bot's People

Contributors

jimbofromlimbo avatar l3g5 avatar micksabox avatar ponderingdemocritus avatar syn22 avatar threepwave avatar

Stargazers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.