Skip to content
This repository was archived by the owner on Oct 5, 2025. It is now read-only.

feat: Additional Features - #1345

Closed
Idris1401 wants to merge 57 commits into
discordjs:mainfrom
Idris1401:feet
Closed

feat: Additional Features#1345
Idris1401 wants to merge 57 commits into
discordjs:mainfrom
Idris1401:feet

Conversation

@Idris1401

@Idris1401 Idris1401 commented Nov 10, 2022

Copy link
Copy Markdown
Contributor

Please describe the changes this PR makes and why it should be merged:
Closes #1342 (normally).
I've copy pasted this from the old v12 guide and tried to adapt it for interactions.

Comment thread guide/popular-topics/reloading-commands.md Outdated
Comment thread guide/popular-topics/reloading-commands.md Outdated
Comment thread guide/.vuepress/sidebar.ts
Comment thread guide/popular-topics/reloading-commands.md Outdated
Comment thread guide/popular-topics/reloading-commands.md Outdated
Comment thread guide/popular-topics/reloading-commands.md Outdated
Comment thread guide/popular-topics/reloading-commands.md Outdated
Comment thread guide/popular-topics/reloading-commands.md Outdated
Comment thread guide/popular-topics/reloading-commands.md
@monbrey

monbrey commented Nov 11, 2022

Copy link
Copy Markdown
Member

I think this is a really good section to have, however the require method doesn't work in ESM. Although we still use CJS I know there's been talk of moving to ESM or at least including snippets for that.

Might be worth including a warning that this won't work in ESM, or try out a module like https://www.npmjs.com/package/hot-esm (untested) and add a separate ESM subsection

Idris1401 and others added 7 commits November 11, 2022 08:19
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
@Idris1401

Copy link
Copy Markdown
Contributor Author

Might be worth including a warning that this won't work in ESM, or try out a module like https://www.npmjs.com/package/hot-esm (untested) and add a separate ESM subsection

Like this? :
https://github.com/discordjs/guide/pull/1345/files#diff-9b1d74c2f242bc898a135fe4ff56667e34bf344bf6e66a6324ed841b16c7a75cR8

Comment thread guide/popular-topics/reloading-commands.md
Comment thread guide/popular-topics/reloading-commands.md
Idris1401 and others added 2 commits November 11, 2022 10:33
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Comment thread guide/popular-topics/reloading-commands.md Outdated
Comment thread guide/popular-topics/reloading-commands.md Outdated
Comment thread guide/popular-topics/reloading-commands.md Outdated
@Jiralite Jiralite added the t: page/section addition Pull Request to add new content to the guide label Nov 14, 2022
Idris1401 and others added 5 commits November 14, 2022 07:29
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Comment thread guide/additional-features/reloading-commands.md Outdated
Comment thread guide/additional-features/reloading-commands.md Outdated
Comment thread guide/additional-features/reloading-commands.md Outdated
Comment thread guide/additional-features/cooldowns.md Outdated
Idris1401 and others added 6 commits November 21, 2022 08:21
Co-authored-by: Jaworek <jaworekwiadomosci@gmail.com>
Co-authored-by: Jaworek <jaworekwiadomosci@gmail.com>
Co-authored-by: Jaworek <jaworekwiadomosci@gmail.com>
Co-authored-by: Jaworek <jaworekwiadomosci@gmail.com>
Co-authored-by: Jaworek <jaworekwiadomosci@gmail.com>
Co-authored-by: Jaworek <jaworekwiadomosci@gmail.com>
Comment thread guide/additional-features/cooldowns.md Outdated

Spam is something you generally want to avoid–especially if one of your commands requires calls to other APIs or takes a bit of time to build/send. Cooldowns are also a very common feature bot developers want to integrate into their projects, so let's get started on that!

This section assumes you followed the [Command Handling](/guide/creating-your-bot/command-handling.md) part.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be good to use the standard TIP for previous sections here

Comment thread guide/additional-features/cooldowns.md Outdated
Comment thread guide/additional-features/cooldowns.md Outdated
Comment thread guide/additional-features/cooldowns.md Outdated
Comment thread guide/additional-features/cooldowns.md Outdated
Comment thread guide/additional-features/cooldowns.md Outdated
});
```

## Command categories

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be integrated with subcommands so that categories are commands and their files are subcommands and make this actually useful

Comment thread guide/.vuepress/sidebar.ts Outdated
Comment thread guide/additional-features/reloading-commands.md Outdated
@megatank58

Copy link
Copy Markdown
Contributor

Also maybe the other pages could've been introduced in different prs this feels like a bit of a mess

Idris1401 and others added 14 commits November 21, 2022 13:48
Co-authored-by: Jaworek <jaworekwiadomosci@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
Co-authored-by: megatank58 <tanumegatank@gmail.com>
async execute(interaction) {
// interaction.user is the object representing the User who ran the command
// interaction.member is the GuildMember object, which represents the user in the specific guild
await interaction.reply(`This command was run by ${interaction.user.username}, who joined on ${interaction.member.joinedAt}.`);

@jaw0r3k jaw0r3k Feb 20, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for every file maybe better use unix timestamps

  1. it looks cool
  2. date after converting to string looks like Mon Feb 20 2023 15:38:11 GMT+0100 (Central European Standard Time)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah but it's just an example
they're free to change the code however they want

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah its just a suggestion

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another alternative could be using timestamp markdown.

@almostSouji
almostSouji requested a review from Jiralite February 24, 2023 16:45
@Idris1401 Idris1401 closed this Feb 25, 2023
@Idris1401
Idris1401 deleted the feet branch February 26, 2023 10:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

t: page/section addition Pull Request to add new content to the guide

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reintroduce the "reload.js" command guide

6 participants