|
246 | 246 | "else:", |
247 | 247 | " $0" |
248 | 248 | ] |
249 | | - } |
| 249 | + }, |
| 250 | + |
| 251 | + "discord.py Exception":{ |
| 252 | + "prefix": "!excpt", |
| 253 | + "body": [ |
| 254 | + "class ${1:My}Error(${2:CommandError}):", |
| 255 | + " \"\"\"${3:Error Description}\"\"\"", |
| 256 | + "", |
| 257 | + " pass" |
| 258 | + ], |
| 259 | + "description": "Add a basic exception." |
| 260 | + }, |
| 261 | + |
| 262 | + "discord.py UI Button":{ |
| 263 | + "prefix": "!button", |
| 264 | + "body": [ |
| 265 | + "class ${1:My}Button(discord.ui.Button):", |
| 266 | + "", |
| 267 | + " async def callback(self, interaction: discord.Interaction):", |
| 268 | + " ${2:return await super().callback(interaction)}" |
| 269 | + ], |
| 270 | + "description": "Add a basic button." |
| 271 | + }, |
| 272 | + |
| 273 | + |
| 274 | + "discord.py Custom UI Button":{ |
| 275 | + "prefix": "!cbutton", |
| 276 | + "body": [ |
| 277 | + "class ${1:My}Button(discord.ui.Button):", |
| 278 | + "", |
| 279 | + " def __init__(self, *, style: ButtonStyle = ..., label: Optional[str] = None,", |
| 280 | + " disabled: bool = False, custom_id: Optional[str] = None,", |
| 281 | + " url: Optional[str] = None, emoji: Optional[Union[str, Emoji, PartialEmoji]] = None,", |
| 282 | + " row: Optional[int] = None, ${2:argname}: ${3:_type}):", |
| 283 | + " super().__init__(style=style, label=label, disabled=disabled,", |
| 284 | + " custom_id=custom_id, url=url, emoji=emoji, row=row, $2=$2)", |
| 285 | + "", |
| 286 | + " async def callback(self, interaction: discord.Interaction):", |
| 287 | + " ${4:return await super().callback(interaction)}", |
| 288 | + " $0" |
| 289 | + ], |
| 290 | + "description": "Add a button with a custom constructor.." |
| 291 | + }, |
| 292 | + |
| 293 | + "discord.py UI Select":{ |
| 294 | + "prefix": "!select", |
| 295 | + "body": [ |
| 296 | + "class ${1:My}Select(discord.ui.Select):", |
| 297 | + "", |
| 298 | + " async def callback(self, interaction: discord.Interaction):", |
| 299 | + " ${2:return await super().callback(interaction)}" |
| 300 | + ], |
| 301 | + "description": "Add a basic select." |
| 302 | + }, |
| 303 | + |
250 | 304 | } |
| 305 | + |
0 commit comments