Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord.JS Module Usage #871

Merged
merged 42 commits into from
Jun 29, 2024
Merged

Discord.JS Module Usage #871

merged 42 commits into from
Jun 29, 2024

Conversation

Glazelf
Copy link
Owner

@Glazelf Glazelf commented Jun 25, 2024

Improve usage of the Discord.JS package in a few key ways:

  • Instead of import Discord from "discord.js", specify which parts are needed.
  • Use SlashCommandBuilder instead of raw json, this avoids repetition and should improve readability.
  • Use ButtonBuilder properly instead of passing objects.
  • Use .setDMPermission(false) instead of current check for DM channels.
    • Remove string from globalVars.

@Glazelf Glazelf self-assigned this Jun 26, 2024
@Glazelf Glazelf added the optimization Code optimization end users will not/barely notice label Jun 26, 2024
@Glazelf Glazelf linked an issue Jun 26, 2024 that may be closed by this pull request
@Glazelf Glazelf added the low priority will fix (later) label Jun 26, 2024
reusing builders is kinda weird
Maybe this should have been several commits but I'm tired
- Rework how guild IDs are handled (see /send)
- Rework a ton of commands
- Give /ban and /send subcommands
- Probably a lot more that I'm forgetting
- Probably new bugs
Makes it more consistent since it happens later in the boot process
Also rework some variable usage
@Glazelf Glazelf marked this pull request as ready for review June 29, 2024 10:14
@Glazelf
Copy link
Owner Author

Glazelf commented Jun 29, 2024

All tasks completed.
Tested boot process and basic commands. Those seem to work so let's merge it whatever.

@Glazelf Glazelf merged commit 8ae0e18 into master Jun 29, 2024
2 checks passed
@Glazelf Glazelf deleted the discord-module-usage branch June 29, 2024 10:14
Glazelf added a commit to T1biriy/NinigiBot that referenced this pull request Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority will fix (later) optimization Code optimization end users will not/barely notice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use SlashCommandBuilder
1 participant