This repository was archived by the owner on May 14, 2026. It is now read-only.
forked from Newer1107/tux
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpython.code-snippets
More file actions
47 lines (47 loc) · 1.42 KB
/
Copy pathpython.code-snippets
File metadata and controls
47 lines (47 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
"Cog": {
"prefix": [
"cog",
],
"scope": "python",
"body": [
"\"\"\"${1:Module description}.",
"",
"${2:Longer description if needed.}",
"\"\"\"",
"",
"from discord.ext import commands",
"",
"from tux.core.base_cog import BaseCog",
"from tux.core.bot import Tux",
"",
"",
"class ${3:CogName}(BaseCog):",
" \"\"\"${4:Cog description}.\"\"\"",
"",
" def __init__(self, bot: Tux) -> None:",
" \"\"\"Initialize the ${3:CogName} cog.",
"",
" Parameters",
" ----------",
" bot : Tux",
" The bot instance to attach this cog to.",
" \"\"\"",
" super().__init__(bot)",
"",
" ${0:# Add commands here}",
"",
"",
"async def setup(bot: Tux) -> None:",
" \"\"\"Set up the ${3:CogName} cog.",
"",
" Parameters",
" ----------",
" bot : Tux",
" The bot instance to add the cog to.",
" \"\"\"",
" await bot.add_cog(${3:CogName}(bot))"
],
"description": "Discord.py cog using BaseCog"
}
}