diff --git a/README.md b/README.md index 39255af..37b31b7 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,20 @@ -# Welcome to Caesar, the Coorinape Discord Bot +# Coordinape Discord Bot -With Web3 communities proliferating and thriving on Discord, Coordinape is -bringing Circle assignment and Epoch alert functionality to Discord! CO Kong -is developed for the purpose of automating Circle assignment, so you can -spend less time signing up members and more time producing and building. +Bringing Coordinape to Discord. -## Caesar Development +## Setting up a Discord Dev bot + +TODO: fill this out + +## Bot Development + +- Reqs: Have yarn 1.22.19 installed +- Install packages with `yarn` + +Start server and backend processs ``` +yarn && yarn dev yarn && yarn serve:dev ``` @@ -23,24 +30,25 @@ In the generated file `src/app/api/zeus/index.ts`, add the following class ```typescript class HasuraWebSocket extends WebSocket { - constructor(address: string, protocols: string) { - super(address, protocols, { - headers: { - 'authorization': process.env.DISCORD_BOT_AUTHORIZATION_HEADER || 'no_secret', - 'x-hasura-role': 'discord-bot', - }, - }); - } + constructor(address: string, protocols: string) { + super(address, protocols, { + headers: { + authorization: + process.env.DISCORD_BOT_AUTHORIZATION_HEADER || "no_secret", + "x-hasura-role": "discord-bot", + }, + }); + } } ``` and then use it as follows inside the `apiSubscription` function ```typescript - const client = createClient({ - url: String(options[0]), - webSocketImpl: HasuraWebSocket, - }); +const client = createClient({ + url: String(options[0]), + webSocketImpl: HasuraWebSocket, +}); ``` 833507b123dbd7102efb408766abe240d2a4df2b (branch `karelianpie:feat/trigger-discord-epoch-events`) @@ -53,10 +61,6 @@ or without subscriptions `yarn zeus http://localhost:8080/v1/graphql ./src/app/api -n --ts -h=x-hasura-admin-secret:admin-secret` -### LogDNA - -LogDNA (now [mezmo.com](https://www.mezmo.com/)) was the service for logging that was implemented originally in the app. - ### Sentry [Sentry](https://sentry.io/) for application monitoring and error tracking diff --git a/docs/INSTALL.md b/docs/INSTALL.md index d4775b9..3ce14cd 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -1,15 +1,5 @@ # Install -This discord bot development is platform agnostic. It can be installed locally on windows or unix systems where the discord is available. - -These tools can make development quick and are recommended: - -- [git CLI](https://git-scm.com) - version control system -- [nodejs v16.16.0](https://nodejs.org/en/) - js runtime built on chrome's v8 engine -- [n](https://github.com/tj/n) - easily change node versions -- [iterm2](https://iterm2.com/) - enhanced terminal for macOS -- [discord](https://discord.com/) - popular chat application used for gaming and organized communities - ## Configuration Setup Before the bot is ready to run there are a few configuration items that should be done. First few steps can be done following @@ -17,7 +7,9 @@ the [discord.js guide](https://discordjs.guide/#before-you-begin); ### 1. Create environment file -Please create a `.env` with the keys below +Please create a `.env` with the keys copied from .env.example. + +For these keys below ``` DISCORD_BOT_TOKEN= @@ -29,6 +21,10 @@ SENTRY_IO_DSN= ``` +you'll need to create bot on the Discord side following the Generate bot token step. + +TODO: add more instructions on this step. + ### 2. Generate bot token [https://discordjs.guide/preparations/setting-up-a-bot-application.html](https://discordjs.guide/preparations/setting-up-a-bot-application.html)