1 |
{ |
2 |
"SudoBot Command Class": { |
3 |
"scope": "typescript", |
4 |
"prefix": "command", |
5 |
"body": [ |
6 |
"import { ArgumentSchema } from \"@framework/arguments/ArgumentTypes\";", |
7 |
"import type { Buildable } from \"@framework/commands/Command\";", |
8 |
"import { Command } from \"@framework/commands/Command\";", |
9 |
"import type Context from \"@framework/commands/Context\";", |
10 |
"", |
11 |
"type ${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}}Args = {", |
12 |
"\targ: string;", |
13 |
"};", |
14 |
"", |
15 |
"@ArgumentSchema.Definition({", |
16 |
"\tnames: [],", |
17 |
"\ttypes: [],", |
18 |
"\toptional: false,", |
19 |
"\terrorMessages: [],", |
20 |
"})", |
21 |
"class ${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}} extends Command {", |
22 |
"\tpublic override readonly name = \"custom\";", |
23 |
"\tpublic override readonly description: string = \"Custom command.\";", |
24 |
"\tpublic override readonly detailedDescription: string = \"Custom command.\";", |
25 |
"\tpublic override readonly defer = true;", |
26 |
"\tpublic override readonly usage = [\"\"];", |
27 |
"\tpublic override readonly systemPermissions = [];", |
28 |
"", |
29 |
"\tpublic override build(): Buildable[] {", |
30 |
"\t\treturn [this.buildChatInput()];", |
31 |
"\t}", |
32 |
"", |
33 |
"\tpublic override async execute(context: Context, args: ${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}}Args): Promise<void> {", |
34 |
"\t\t// Add your custom command logic here", |
35 |
"\t}", |
36 |
"}", |
37 |
"", |
38 |
"export default ${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}};" |
39 |
] |
40 |
}, |
41 |
"SudoBot Service Class": { |
42 |
"scope": "typescript", |
43 |
"prefix": "service", |
44 |
"body": [ |
45 |
"import { Name } from \"@framework/services/Name\";", |
46 |
"import { Service } from \"@framework/services/Service\";", |
47 |
"", |
48 |
"@Name(\"${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}}\")", |
49 |
"class ${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}} extends Service {", |
50 |
"\t// TODO: Implement service", |
51 |
"}", |
52 |
"", |
53 |
"export default ${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}};" |
54 |
] |
55 |
}, |
56 |
"SudoBot Queue Class": { |
57 |
"scope": "typescript", |
58 |
"prefix": "queue", |
59 |
"body": [ |
60 |
"import Queue from \"@framework/queues/Queue\";", |
61 |
"", |
62 |
"type ${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}}Payload = {", |
63 |
"\t// TODO: Add payload properties", |
64 |
"};", |
65 |
"", |
66 |
"class ${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}} extends Queue<${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}}Payload> {", |
67 |
"\tpublic static override readonly uniqueName = \"${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}}\";", |
68 |
"", |
69 |
"\tpublic async execute(payload: ${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}}Payload) {", |
70 |
"\t\t// TODO: Implement queue logic", |
71 |
"\t}", |
72 |
"}", |
73 |
"", |
74 |
"export default ${1:${TM_FILENAME_BASE/(.*?)\\..*/$1/}};" |
75 |
] |
76 |
} |
77 |
} |