Files
snippets/snippets/snippets.code-snippets
George Needham 40e61226e4 feat: make all event/command snips async
Made each snippet asynchronous
2023-06-20 17:11:38 -05:00

60 lines
2.6 KiB
Plaintext

{
// Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"sern: Send ephemeral message": {
"scope": "js,ts",
"prefix": "ctxeph",
"body": ["await ctx.reply({ content: `$1`, ephemeral: true })"],
"description": "Send an ephemeral message with some content."
},
"sern: Send message with empty array": {
"scope": "js,ts",
"prefix": "ctxopt",
"body": ["await ctx.reply({ $1 })"],
"description": "Send a message with an empty array."
},
"sern: Create a simple event": {
"scope": "js,ts",
"prefix": "sernevent",
"body": [
"const { EventType, eventModule } = require('@sern/handler');\r\n\r\nexport default eventModule({\r\n type: EventType.${1:Discord},\r\n name : '$2',\r\n execute: async () => {\r\n $4\r\n }\r\n })"
],
"description": "Create a simple event in sern."
},
"sern: Create a simple command": {
"scope": "js,ts",
"prefix": "serncommand",
"body": [
"const { commandModule, CommandType } = require('@sern/handler');\r\n\r\nexport default commandModule({\r\n\ttype: CommandType.$1,\r\n\tplugins: [],\r\n\tdescription: '$2',\r\n\toptions: [],\r\n\texecute: async (ctx) => {\r\n\t\t$3\r\n\t},\r\n});"
],
"description": "Create a simple command in sern."
},
"sern: Create a simple ESM event": {
"scope": "js,ts",
"prefix": "serneventesm",
"body": [
"import { EventType, eventModule } from '@sern/handler';\r\n\r\nexport default eventModule({\r\n type: EventType.${1:Discord},\r\n name : '$2',\r\n execute: async () => {\r\n $4\r\n }\r\n })"
],
"description": "Create a simple event in sern."
},
"sern: Create a simple ESM command": {
"scope": "js,ts",
"prefix": "serncommandesm",
"body": [
"import { commandModule, CommandType } from '@sern/handler';\r\n\r\nexport default commandModule({\r\n\ttype: CommandType.$1,\r\n\tplugins: [],\r\n\tdescription: '$2',\r\n\toptions: [],\r\n\texecute: async (ctx) => {\r\n\t\t$3\r\n\t},\r\n});"
],
"description": "Create a simple command in sern."
}
}