|
8 | 8 | "", |
9 | 9 | "bot = commands.Bot(command_prefix=\"${1:!}\")", |
10 | 10 | "", |
| 11 | + "@bot.event()", |
| 12 | + "async def on_ready():", |
| 13 | + " print(f\"Logged in as {bot.user}\")", |
| 14 | + "", |
11 | 15 | "@bot.command()", |
12 | 16 | "async def hello(ctx):", |
13 | 17 | " await ctx.send(\"Hello, I am a robot\")", |
|
247 | 251 | " $0" |
248 | 252 | ] |
249 | 253 | }, |
250 | | - |
| 254 | + |
251 | 255 | "discord.py Exception":{ |
252 | 256 | "prefix": "!except", |
253 | 257 | "body": [ |
|
258 | 262 | ], |
259 | 263 | "description": "Add a basic exception." |
260 | 264 | }, |
261 | | - |
| 265 | + |
262 | 266 | "discord.py UI Button":{ |
263 | 267 | "prefix": "!button", |
264 | 268 | "body": [ |
265 | 269 | "class ${1:My}Button(discord.ui.Button):", |
266 | 270 | "", |
267 | 271 | " async def callback(self, interaction: discord.Interaction):", |
268 | | - " ${2:return await super().callback(interaction)}" |
| 272 | + " ${2:return await super().callback(interaction)}" |
269 | 273 | ], |
270 | 274 | "description": "Add a basic button." |
271 | 275 | }, |
272 | | - |
| 276 | + |
273 | 277 |
|
274 | 278 | "discord.py Custom UI Button":{ |
275 | 279 | "prefix": "!cbutton", |
276 | 280 | "body": [ |
277 | | - "class ${1:My}Button(discord.ui.Button):", |
| 281 | + "class ${1:My}Button(discord.ui.Button):", |
278 | 282 | "", |
279 | 283 | " def __init__(self, *, style: ButtonStyle = ..., label: Optional[str] = None,", |
280 | 284 | " disabled: bool = False, custom_id: Optional[str] = None,", |
281 | 285 | " url: Optional[str] = None, emoji: Optional[Union[str, Emoji, PartialEmoji]] = None,", |
282 | | - " row: Optional[int] = None, ${2:argname}: ${3:_type}):", |
| 286 | + " row: Optional[int] = None, ${2:argname}: ${3:_type}):", |
283 | 287 | " super().__init__(style=style, label=label, disabled=disabled,", |
284 | 288 | " custom_id=custom_id, url=url, emoji=emoji, row=row, $2=$2)", |
285 | 289 | "", |
|
293 | 297 | "discord.py UI Select":{ |
294 | 298 | "prefix": "!select", |
295 | 299 | "body": [ |
296 | | - "class ${1:My}Select(discord.ui.Select):", |
| 300 | + "class ${1:My}Select(discord.ui.Select):", |
297 | 301 | "", |
298 | 302 | " async def callback(self, interaction: discord.Interaction):", |
299 | 303 | " ${2:return await super().callback(interaction)}" |
|
0 commit comments