Skip to content

Commit 84d0041

Browse files
committed
feat(snippets): Change prefix to dis.
1 parent 43accf1 commit 84d0041

File tree

1 file changed

+41
-32
lines changed

1 file changed

+41
-32
lines changed

snippets/snippets.code-snippets

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"Disnake Main Template": {
3-
"prefix": "!dstart",
2+
"Disnake Main File": {
3+
"prefix": ["dis.main", "dis.template", "dis.bot"],
44
"body": [
55
"import disnake",
66
"from disnake.ext import commands",
@@ -11,65 +11,74 @@
1111
"",
1212
"@bot.event",
1313
"async def on_ready():",
14-
" print(f\"Logged in as {bot.user}.\")",
14+
"\tprint(f\"Logged in as {bot.user}.\")",
1515
"",
1616
"",
1717
"bot.run(\"${2:BOT_TOKEN}\")",
1818
""
1919
],
2020
},
21-
"Disnake Prefix Command Template": {
22-
"prefix": "!cmd",
21+
"Disnake Prefix Command": {
22+
"prefix": ["dis.cmd", "dis.command", "dis.prefix"],
2323
"description": "A command template",
2424
"body": [
2525
"@${1|bot,client|}.command(${2:aliases=[\"$3\"]})",
2626
"async def ${4:command_name}(ctx$5):",
27-
" $0"
28-
],
29-
},
30-
"Disnake Event Template": {
31-
"prefix": "!evt",
32-
"description": "An event template",
33-
"body": [
34-
"@${1|bot,client|}.event",
35-
"async def on_$2($3):",
36-
" $0"
27+
"\t$0"
3728
],
3829
},
39-
"Disnake Cog Command Template": {
40-
"prefix": "!cogcmd",
41-
"description": "A prefix command template for cogs",
30+
"Disnake Slash Command": {
31+
"prefix": "dis.slash",
32+
"description": "A slash command template",
4233
"body": [
43-
"@commands.command(${1:aliases=[\"$2\"]})",
44-
"async def ${3:command_name}(self, ctx$4):",
34+
"@${1|bot,client|}.slash_command({2:guild_ids=[\"$3\"]})",
35+
"async def ${4:command_name}(ctx$5):",
4536
"\t$0"
4637
],
4738
},
48-
"Disnake Cog Event Template": {
49-
"prefix": "!cogevt",
39+
"Disnake Event": {
40+
"prefix": "dis.evt",
41+
"description": "An event template",
5042
"body": [
51-
"@commands.Cog.listener()",
52-
"async def on_$1(self, $2):",
53-
" $0"
43+
"@${1|bot,client|}.event",
44+
"async def on_$2($3):",
45+
"\t$0"
5446
],
5547
},
56-
"Disnake Cog Template": {
57-
"prefix": "!cog",
48+
"Disnake Cog": {
49+
"prefix": "dis.cog",
5850
"body": [
5951
"import disnake",
6052
"from disnake.ext import commands",
6153
"",
6254
"",
6355
"class ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}}(commands.Cog):",
6456
"",
65-
" def __init__(self, bot):",
66-
" self.bot = bot",
57+
"\tdef __init__(self, bot):",
58+
"\t\tself.bot = bot",
6759
"",
68-
" $0",
60+
"\t$0",
6961
"",
7062
"def setup(bot):",
71-
" bot.add_cog(${1:CogName}(bot))",
63+
"\tbot.add_cog(${1:CogName}(bot))",
7264
""
7365
],
7466
},
75-
}
67+
"Disnake Cog Command": {
68+
"prefix": "dis.cog.cmd",
69+
"description": "A prefix command template for cogs",
70+
"body": [
71+
"@commands.command(${1:aliases=[\"$2\"]})",
72+
"async def ${3:command_name}(self, ctx$4):",
73+
"\t$0"
74+
],
75+
},
76+
"Disnake Cog Event": {
77+
"prefix": "dis.cog.evt",
78+
"body": [
79+
"@commands.Cog.listener()",
80+
"async def on_$1(self, $2):",
81+
"\t$0"
82+
],
83+
},
84+
}

0 commit comments

Comments
 (0)