You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,7 @@ I would've been happy if there were any template existing. However, there wasn't
17
17
decided to create my own template to let <b>you</b> guys create your discord bot easily.
18
18
19
19
Please note that this template is not supposed to be the best template, but a good template to start learning how
20
-
discord.py works and to make your own bot easily. After the version 4.0 the template is using disnake, as discord.py has
21
-
stoppped development.
20
+
discord.py works and to make your own bot easily.
22
21
23
22
If you plan to use this template to make your own template or bot, you **have to**:
24
23
@@ -40,22 +39,21 @@ All the updates of the template are available [here](UPDATES.md).
40
39
41
40
## Disclaimer
42
41
43
-
Slash commands can take **some hours** to get registered on guilds, so if you want to test a command you should use
44
-
the `guild_ids` parameter in the command decorator so that it gets registered instantly. Example:
42
+
Slash commands can take some time to get registered globally, so if you want to test a command you should use
43
+
the `@app_commands.guilds()` decorator so that it gets registered instantly. Example:
45
44
46
45
```py
47
-
@commands.slash_command(
48
-
name="command",
49
-
description="Command description",
50
-
guild_ids=[GUILD_ID1, GUILD_ID2] # These should be testing guild(s) ID, as always: an integer.
46
+
@commands.hybrid_command(
47
+
name="command",
48
+
description="Command description",
51
49
)
50
+
@app_commands.guilds(GUILD_ID) # Place your guild ID here
52
51
```
53
52
54
53
When using the template you confirm that you have read the [license](LICENSE.md) and comprehend that I can take down
55
54
your repository if you do not meet these requirements.
56
55
57
-
Please do not open issues or pull requests about things that are written in the [TODO file](TODO.md), they are **
58
-
already** under work for a future version of the template.
56
+
Please do not open issues or pull requests about things that are written in the [TODO file](TODO.md), they are **already** under work for a future version of the template.
59
57
60
58
## How to download it
61
59
@@ -90,7 +88,6 @@ Here is an explanation of what everything is:
90
88
| YOUR_APPLICATION_ID_HERE | The application ID of your bot |
91
89
| OWNERS | The user ID of all the bot owners |
92
90
93
-
In the [blacklist](blacklist.json) file you now can add IDs (as integers) in the `ids` list.
print(f"Failed to load extension {extension}\n{exception}")
116
-
117
-
118
-
if__name__=="__main__":
119
-
"""
120
-
This will automatically load slash commands and normal commands located in their respective folder.
121
-
122
-
If you want to remove slash commands, which is not recommended due to the Message Intent being a privileged intent, you can remove the loading of slash commands below.
The code in this event is executed every time a valid slash command catches an error
157
-
158
-
'ephemeral=True' will make so that only the user who execute the command can see the message
159
-
160
-
:param interaction: The slash command that failed executing.
161
-
:param error: The error that has been faced.
162
-
"""
163
-
ifisinstance(error, commands.CommandOnCooldown):
164
-
minutes, seconds=divmod(error.retry_after, 60)
165
-
hours, minutes=divmod(minutes, 60)
166
-
hours=hours%24
167
-
embed=disnake.Embed(
168
-
title="Hey, please slow down!",
169
-
description=f"You can use this command again in {f'{round(hours)} hours'ifround(hours) >0else''}{f'{round(minutes)} minutes'ifround(minutes) >0else''}{f'{round(seconds)} seconds'ifround(seconds) >0else''}.",
description=f"You can use this command again in {f'{round(hours)} hours'ifround(hours) >0else''}{f'{round(minutes)} minutes'ifround(minutes) >0else''}{f'{round(seconds)} seconds'ifround(seconds) >0else''}.",
0 commit comments