Home

Awesome

Squire

Squire is a multitalented bot that interfaces with Discord and Twitter. Currently, this repo is heavily catered towards the needs of Bibliotheca DAO and the Lootverse in general.

However, further abstraction is needed to make this bot plug and playable by other teams. But by all means, fork him and customize.


What Squire currently does:


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:

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

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.

export NODE_TLS_REJECT_UNAUTHORIZED='0' export NODE_OPTIONS='--experimental-fetch'