File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { OptionType } from "#plugin/core/public/command.ts";
33import { defineCommand } from "#plugin/core/public/extensionPoints.ts" ;
44import { permissionsGuard } from "#plugin/core/public/helper/commandGuards.ts" ;
55import { icons } from "#plugin/core/public/icons.ts" ;
6- import { tagsConfigStore } from "#plugin/tags/index.ts" ;
6+ import { MAX_TAG_NAME_LENGTH , tagsConfigStore } from "#plugin/tags/index.ts" ;
77import { getTag , searchTags } from "#plugin/tags/storage/tags.ts" ;
88
99export default defineCommand ( {
@@ -15,6 +15,7 @@ export default defineCommand({
1515 name : [ "name" , "n" ] ,
1616 required : true ,
1717 position : 0 ,
18+ maxLength : MAX_TAG_NAME_LENGTH ,
1819
1920 autocomplete : ( ctx , value ) =>
2021 searchTags ( ctx . squirrelCtx . db , ctx . guild . id , value ) ,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { OptionType } from "#plugin/core/public/command.ts";
33import { defineCommand } from "#plugin/core/public/extensionPoints.ts" ;
44import { permissionsGuard } from "#plugin/core/public/helper/commandGuards.ts" ;
55import { icons } from "#plugin/core/public/icons.ts" ;
6- import { tagsConfigStore } from "#plugin/tags/index.ts" ;
6+ import { MAX_TAG_NAME_LENGTH , tagsConfigStore } from "#plugin/tags/index.ts" ;
77import { deleteTag , searchTags } from "#plugin/tags/storage/tags.ts" ;
88
99export default defineCommand ( {
@@ -16,6 +16,7 @@ export default defineCommand({
1616 name : [ "name" , "n" ] ,
1717 required : true ,
1818 position : 0 ,
19+ maxLength : MAX_TAG_NAME_LENGTH ,
1920
2021 autocomplete : ( ctx , value ) =>
2122 searchTags ( ctx . squirrelCtx . db , ctx . guild . id , value ) ,
Original file line number Diff line number Diff line change @@ -3,7 +3,11 @@ import { OptionType } from "#plugin/core/public/command.ts";
33import { defineCommand } from "#plugin/core/public/extensionPoints.ts" ;
44import { permissionsGuard } from "#plugin/core/public/helper/commandGuards.ts" ;
55import { icons } from "#plugin/core/public/icons.ts" ;
6- import { tagsConfigStore } from "#plugin/tags/index.ts" ;
6+ import {
7+ MAX_TAG_CONTENT_LENGTH ,
8+ MAX_TAG_NAME_LENGTH ,
9+ tagsConfigStore ,
10+ } from "#plugin/tags/index.ts" ;
711import {
812 createTag ,
913 searchTags ,
@@ -23,6 +27,7 @@ export default defineCommand({
2327 "The name of the tag - a tag with this name will be created if it doesn't currently exist." ,
2428 required : true ,
2529 position : 0 ,
30+ maxLength : MAX_TAG_NAME_LENGTH ,
2631 greedy : false ,
2732
2833 autocomplete : ( ctx , value ) =>
@@ -33,6 +38,7 @@ export default defineCommand({
3338 name : [ "content" , "c" ] ,
3439 required : true ,
3540 position : 1 ,
41+ maxLength : MAX_TAG_CONTENT_LENGTH ,
3642 } ,
3743 existing : {
3844 type : OptionType . Flag ,
Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ import { TagsConfig } from "#plugin/tags/config.ts";
88
99export const tagsConfigStore = new ConfigStore ( TagsConfig ) ;
1010
11+ export const MAX_TAG_NAME_LENGTH = 30 ;
12+ export const MAX_TAG_CONTENT_LENGTH = 4000 ;
13+
1114const defaultConfig = `enabled = false
1215
1316# Example: allow admins to create tags
You can’t perform that action at this time.
0 commit comments