Skip to content

Commit

Permalink
Merge pull request quark-bot-discord#9 from quark-bot-discord/develop…
Browse files Browse the repository at this point in the history
…ment

30/6/24 Update
  • Loading branch information
Starman3787 authored Jun 30, 2024
2 parents c592a3e + 3bf54f0 commit 2b8e4f3
Show file tree
Hide file tree
Showing 34 changed files with 488 additions and 30 deletions.
24 changes: 13 additions & 11 deletions .github/scripts/validate-slash_commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const conversionFile = './bot/languages.json';

let foundErrors = false;

const nonChatInputCommands = ["initialReactor.json"];

try {
const conversionData = fs.readFileSync(conversionFile, 'utf8');
const languageMap = JSON.parse(conversionData);
Expand Down Expand Up @@ -41,11 +43,11 @@ try {
const currentPath = path ? `${path}.${key}` : key;

if (typeof value === 'string') {

if (currentPath.endsWith('.description') && value.length > 100) {
console.error(`Validation error: ${directory}/${file}: Description exceeds 100 characters at '${currentPath}'`);
foundErrors = true;
}

if (currentPath.endsWith('.name') && value.match(/^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$/gu) == null) {
console.error(`Validation error: ${directory}/${file}: Name does not match regex at '${currentPath}', VALUE: ${value}`);
foundErrors = true;
Expand All @@ -54,23 +56,23 @@ try {
console.error(`Validation error: ${directory}/${file}: Key '${currentPath}' must be lowercase`);
foundErrors = true;
}

} else if (typeof value === 'object' && value !== null) {
checkFields(value, currentPath);
}
});
}
if (!nonChatInputCommands.includes(file)) {
checkFields(jsonData);

checkFields(jsonData);

if (jsonData.name && jsonData.name.match(/^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$/gu) == null) {
console.error(`Validation error: ${directory}/${file}: Name does not match regex, VALUE: ${jsonData.name}`);
foundErrors = true;
} else if (jsonData.description && jsonData.description.length > 100) {
console.error(`Validation error: ${directory}/${file}: Description exceeds 100 characters at 'description'`);
foundErrors = true;
if (jsonData.name && jsonData.name.match(/^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$/gu) == null) {
console.error(`Validation error: ${directory}/${file}: Name does not match regex, VALUE: ${jsonData.name}`);
foundErrors = true;
} else if (jsonData.description && jsonData.description.length > 100) {
console.error(`Validation error: ${directory}/${file}: Description exceeds 100 characters at 'description'`);
foundErrors = true;
}
}

} catch (err) {
console.error(`Error processing ${file}:`, err);
foundErrors = true;
Expand Down
4 changes: 4 additions & 0 deletions bot/en_gb/access_token.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"1": "Admin",
"2": "Basic"
}
15 changes: 12 additions & 3 deletions bot/en_gb/command_responses.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
"response-unban": "Unbanned",
"response-purge": "Purged {count} messages",

"response-customise-dash": "Customisation settings have moved to our [web dashboard]!",
"response-customise-1": "Log messages up to 2 weeks old, customise logs, and so much more with Quark Pro...",
"response-customise-dash": "Customisation settings have moved to Quark's [web dashboard]!",
"response-customise-1": "Log messages up to 8 weeks old, customise logs, and so much more with Quark Pro...",
"response-customise-2": "[UK, US, EU] Click onto my profile to upgrade!",
"response-customise-3": "Or... {proLink}",
"response-customise-3": "See subscriptions... {proLink}",
"response-customise-4": "Try out colour customisation for free at {inventoryLink}",

"response-case-updated": "Case updated!",
Expand Down Expand Up @@ -104,6 +104,8 @@
"setserverlog-type-channels-1": "channel events",
"setserverlog-type-modlogs-0": "Modlogs",
"setserverlog-type-modlogs-1": "modlogs",
"setserverlog-type-quark-0": "Quark Events",
"setserverlog-type-quark-1": "quark events",
"setserverlog-spoilers": "Spoilers",
"setserverlog-spoilers-0": "Serverlog spoilers set to {result}",
"setserverlog-enable-status-updates": "Enable Status Updates!",
Expand Down Expand Up @@ -158,6 +160,9 @@
"need-to-vote": "Click here to vote",
"need-to-vote-footer": "Votes take up to a minute to be registered",

"initialreactors-expired": "expired",
"initialreactors-notfound": "No reactions found",

"configCommand": {
"title": "Serverlog Configuration",
"selection": "Select a category in the menu to view configuration.",
Expand Down Expand Up @@ -206,6 +211,10 @@
"title": "Overview",
"description": "Overview of main category options"
},
"quarkEvents": {
"title": "Quark Config",
"description": "Changes made to Quark's configuration for this server"
},
"fileEvents": {
"title": "Files"
}
Expand Down
4 changes: 4 additions & 0 deletions bot/en_gb/gui_constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,9 @@
"explicit_content_filter": "Explicit Content Filter",
"nsfw_level": "NSFW Level",
"premium_progress_bar_enabled": "Progress Bar"
},
"webhookModificationTypes": {
"name": "Name",
"channel_id": "Channel"
}
}
12 changes: 12 additions & 0 deletions bot/en_gb/ignore_options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"ignoreTargets": "Ignore Target Users",
"ignoreExecutors": "Ignore Target Executors",
"specificMessageContent": "Ignore Specific Message Content",
"ignoreChannels": "Ignore Channels",
"ignoreBotExecutors": "Ignore Bot Executors",
"ignoreBotTargets": "Ignore Bot Targets",
"ignoreExecutorRoles": "Ignore Executor Roles",
"ignoreTargetRoles": "Ignore Target Roles",
"ignoreCategories": "Ignore Categories",
"activeIgnore": "Active Ignore"
}
13 changes: 13 additions & 0 deletions bot/en_gb/log_categories.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"serverEvents": "Members",
"serverActions": "Actions",
"textEvents": "Messages",
"voiceEvents": "Voice",
"fileEvents": "Files",
"generalEvents": "Server",
"roleEvents": "Roles",
"channelEvents": "Channels",
"quarkEvents": "Quark Config",
"modLog": "Modlogs",
"main": "Main"
}
7 changes: 7 additions & 0 deletions bot/en_gb/log_formats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"0": "Standard",
"1": "Compact",
"2": "Standard (no embed)",
"3": "Compact (no embed)",
"4": "json"
}
4 changes: 4 additions & 0 deletions bot/en_gb/slash_commands/dashboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "dashboard",
"description": "Visit Quark's web dashboard"
}
3 changes: 3 additions & 0 deletions bot/en_gb/slash_commands/initialReactor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "See initial reactors"
}
4 changes: 4 additions & 0 deletions bot/en_gb/slash_commands/premium.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "premium",
"description": "Get information about the premium subscriptions Quark has"
}
32 changes: 32 additions & 0 deletions bot/en_gb/standard/channelEvents.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,37 @@
"description": "{executor} updated permissions for {channel} for {special}",
"newPermissions": "New Permissions",
"viewFullNewPermissions": "View Full New Permissions"
},
"webhookCreate": {
"title": "Webhook Created",
"description": "{executor} created a webhook {webhook} in {channel}"
},
"webhookDelete": {
"title": "Webhook Deleted",
"description": "{executor} deleted the webhook {webhook}"
},
"webhookUpdate": {
"title": "Webhook Modified",
"description": "{executor} modified the webhook {webhook}"
},
"webhookAvatarUpdate": {
"title": "Webhook Avatar Updated",
"description": "{executor} updated the avatar for {webhook}",
"description_added": "{executor} added an avatar for {webhook}",
"description_removed": "{executor} removed the avatar for {webhook}",
"linkToOldAvatar": "Link to old avatar",
"linkToNewAvatar": "Link to new avatar"
},
"statusChannelFollowed": {
"title": "Channel Followed",
"description": "{executor} followed the channel {name} in {channel}"
},
"statusChannelUnfollowed": {
"title": "Channel Unfollowed",
"description": "{executor} unfollowed the channel {name}"
},
"statusChannelUpdated": {
"title": "Followed Channel Updated",
"description": "{executor} updated the followed channel {name}"
}
}
64 changes: 64 additions & 0 deletions bot/en_gb/standard/quarkEvents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"serverlogChannelUpdate": {
"title": "Logging Channel Changed",
"description_set": "{executor} set the {type} logging channel to {channel}",
"description_category_disable": "{executor} disabled the {type} logging channel",
"description_unset": "{executor} unset the {type} logging channel"
},
"serverlogOptionsUpdate": {
"title": "Logging Options Updated",
"description": "{executor} set {option} to {state}",
"pluralkitSupport": "PluralKit Support",
"spoilers": "Spoilers",
"buttons": "Buttons",
"formatType": "Format Type"
},
"serverlogLogUpdate": {
"title": "Log Updated",
"description": "{executor} updated the {type} log",
"enabled": "Enabled",
"logFormat": "Format",
"logChannel": "Channel",
"colour": "Colour",
"ignoreBotExecutors": "Ignore Bot Executors",
"ignoreBotTargets": "Ignore Bot Targets",
"activeIgnore": "Active Ignore"
},
"serverlogIgnoreUpdate": {
"title": "Ignore Options Updated",
"description_set": "{executor} enabled {type}",
"description_unset": "{executor} disabled {type}",
"description_added": "{executor} added {target} to {type}",
"description_removed": "{executor} removed {target} from {type}"
},
"languageUpdate": {
"title": "Language Changed",
"description": "{executor} changed the language to {language}"
},
"reset": {
"title": "Configuration Reset",
"description": "{executor} reset the configuration for this server"
},
"tagAdded": {
"title": "Tag Added",
"description": "{executor} created a tag {tag}"
},
"tagUpdated": {
"title": "Tag Updated",
"description": "{executor} updated the tag {tag}"
},
"tagDeleted": {
"title": "Tag Deleted",
"description": "{executor} deleted the tag {tag}"
},
"tokenAdded": {
"title": "Token Generated",
"description": "{executor} generated a Quark access token with {permissions} permissions for this server",
"unique_id": "Token ID",
"revoke": "Revoke this token"
},
"tokenRevoked": {
"title": "Token Revoked",
"description": "{executor} revoked the Quark access token with ID {token}"
}
}
3 changes: 2 additions & 1 deletion bot/en_gb/standard/textEvents.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"sticker": "sticker",
"noContent": "no content",
"embed": "embed",
"thread": "Thread"
"thread": "Thread",
"initialReactor": "initial reactor"
},
"messagesBulkDeleted": {
"title": "Multiple Messages Deleted",
Expand Down
4 changes: 4 additions & 0 deletions bot/en_pr/access_token.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"1": "Admin",
"2": "Basic"
}
13 changes: 11 additions & 2 deletions bot/en_pr/command_responses.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
"response-unban": "Unbanned",
"response-purge": "Purged {count} messages",

"response-customise-dash": "Customisation settings have moved to our [web dashboard]!",
"response-customise-dash": "Customisation settings have moved to Quark's [web dashboard]!",
"response-customise-1": "Log messages up to 2 weeks old, customise logs, and so much more with Quark Pro...",
"response-customise-2": "[UK, US, EU] Click onto my profile to upgrade!",
"response-customise-3": "Or... {proLink}",
"response-customise-3": "See subscriptions... {proLink}",
"response-customise-4": "Try out colour customisation for free at {inventoryLink}",

"response-case-updated": "Case updated!",
Expand Down Expand Up @@ -104,6 +104,8 @@
"setserverlog-type-channels-1": "channel events",
"setserverlog-type-modlogs-0": "Modlogs",
"setserverlog-type-modlogs-1": "modlogs",
"setserverlog-type-quark-0": "Quark Events",
"setserverlog-type-quark-1": "quark events",
"setserverlog-spoilers": "Spoilers",
"setserverlog-spoilers-0": "Serverlog spoilers set to {result}",
"setserverlog-enable-status-updates": "Enable Status Updates!",
Expand Down Expand Up @@ -158,6 +160,9 @@
"need-to-vote": "Click here to vote",
"need-to-vote-footer": "Votes take up to a minute to be registered",

"initialreactors-expired": "expired",
"initialreactors-notfound": "No reactions found",

"configCommand": {
"title": "Serverlog Configuration",
"selection": "Select a category in the menu to view configuration.",
Expand Down Expand Up @@ -206,6 +211,10 @@
"title": "Overview",
"description": "Overview of main category options"
},
"quarkEvents": {
"title": "Quark Config",
"description": "Changes made to Quark's configuration for this server"
},
"fileEvents": {
"title": "Files"
}
Expand Down
12 changes: 12 additions & 0 deletions bot/en_pr/ignore_options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"ignoreTargets": "Ignore Target Users",
"ignoreExecutors": "Ignore Target Executors",
"specificMessageContent": "Ignore Specific Message Content",
"ignoreChannels": "Ignore Channels",
"ignoreBotExecutors": "Ignore Bot Executors",
"ignoreBotTargets": "Ignore Bot Targets",
"ignoreExecutorRoles": "Ignore Executor Roles",
"ignoreTargetRoles": "Ignore Target Roles",
"ignoreCategories": "Ignore Categories",
"activeIgnore": "Active Ignore"
}
13 changes: 13 additions & 0 deletions bot/en_pr/log_categories.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"serverEvents": "Members",
"serverActions": "Actions",
"textEvents": "Messages",
"voiceEvents": "Voice",
"fileEvents": "Files",
"generalEvents": "Server",
"roleEvents": "Roles",
"channelEvents": "Channels",
"quarkEvents": "Quark Config",
"modLog": "Modlogs",
"main": "Main"
}
7 changes: 7 additions & 0 deletions bot/en_pr/log_formats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"0": "Standard",
"1": "Compact",
"2": "Standard (no embed)",
"3": "Compact (no embed)",
"4": "json"
}
Loading

0 comments on commit 2b8e4f3

Please sign in to comment.