Skip to content

Latest commit

 

History

History
82 lines (59 loc) · 2.15 KB

README.md

File metadata and controls

82 lines (59 loc) · 2.15 KB

DopeBot

A very dope bot for the DopeWars discord ;)

Scopes And Permissions

Scopes

  • bot
  • application.commands

Permission

  • Manage Channels
  • Read Messages/View Channels
  • Send Messages
  • Send Messages in Threads
  • Manage Messages
  • Embed Links
  • Attach Files
  • Add Reactions
  • Use Slash Commands

Environment Variables

In order for the bot to work correctly, you need to set the following environment variables:

DBOT_CLIENT_TOKEN=
DBOT_TWITTER_BEARER_TOKEN=
DBOT_QX_API_KEY=
DBOT_OS_API_KEY=
DBOT_CLIENT_ID=
DBOT_GUILD_ID=
ENV=test/prod

Running the bot

Without the DopeWars Api

docker-compose up bot redis

With the DopeWars Api

docker-compose up bot

The Api already contains a redis service.

Example message for the Auth flow through redis-cli

PUBLISH discord '{"id":"your-discord-id","walletaddress":"test","papercount":0,"dopecount":0,"hustlercount":0,"isog":true}'

Adding Commands/Events

If your command does not match an existing command type, you can simply create a new commandName.ts file and drop it into the commands folder. It does not matter where you put it, as long as it is in a sub directory of commands. Folder names are being ignored, so you can name them as you wish. Events must be dropped into the events folder.

Command Template

export default {
  data: new SlashCommandBuilder(),  /* https://discordjs.guide/interactions/slash-commands.html#options */
  async execute(interaction: CommandInteraction): Promise<void> {
    try {
      await interaction.reply("Guten Morgen!");
    } catch(error: unkown) {
      return Promise.reject(error);
    }
  }
}

Event Template

export default {
  name: "eventName",  /* https://discordjs.guide/creating-your-bot/event-handling.html#event-handling */
  once: true/false, /* The bot logging in is a "once" event, users executing a command is not */
  async execute(arg): Promise<void> { /* arg type depends on which event you chose, for e.g. "guildMemberAdd" will pass a "member: GuildMember" */
    
  }
}