CodecademyCommunity / codecademy-discord-bot

Custom moderation bot for the official Codecademy Community Discord server.
https://codecademycommunity.github.io/
MIT License
11 stars 1 forks source link

Convert infractions commands to slash commands #302

Closed mikejoh12 closed 2 years ago

lyallstewart commented 2 years ago

I'll work on this one if no-one else is?

mikejoh12 commented 2 years ago

Issue 164, that infractions commands don't work if users have left the server, should be possible to fix when converting to slash commands. The code below adds code to ask for the user in the slashcommand-builder:

    .addUserOption((option) =>
      option.setName('target').setDescription('The user').setRequired(true)
    ),

I tested this with the notes-commands and a user id can still be entered even if the user has left the server. This will give access to a user object in the command so that the command can still work properly.