Archived
0
0
Fork 0

fix(help): fixed several minor bugs

This commit is contained in:
Daryl Ronningen 2021-06-30 20:02:33 -05:00
parent 7cf734ec68
commit 3aae6185eb
Signed by: Daryl Ronningen
GPG key ID: FD23F0C934A5EC6B
7 changed files with 158 additions and 17 deletions

View file

@ -50,7 +50,9 @@
"luxon": "^1.27.0", "luxon": "^1.27.0",
"module-alias": "^2.2.2", "module-alias": "^2.2.2",
"node-gyp": "^8.1.0", "node-gyp": "^8.1.0",
"pg": "^8.6.0",
"sodium": "^3.0.2", "sodium": "^3.0.2",
"sql-template-strings": "^2.2.2",
"terminal-link": "^3.0.0", "terminal-link": "^3.0.0",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"typescript": "^4.3.4", "typescript": "^4.3.4",
@ -75,6 +77,7 @@
"@types/mocha": "^8.2.2", "@types/mocha": "^8.2.2",
"@types/module-alias": "^2.0.0", "@types/module-alias": "^2.0.0",
"@types/node": "^15.12.5", "@types/node": "^15.12.5",
"@types/pg": "^8.6.0",
"@types/rimraf": "^3.0.0", "@types/rimraf": "^3.0.0",
"@types/sinon": "^10.0.2", "@types/sinon": "^10.0.2",
"@types/source-map-support": "^0.5.3", "@types/source-map-support": "^0.5.3",

View file

@ -113,7 +113,7 @@ export default class extends Command {
if(currentPage + 1 !== commandGroups.length) { if(currentPage + 1 !== commandGroups.length) {
nextCategoryBtn.setDisabled(false); nextCategoryBtn.setDisabled(false);
previousCategoryBtn.setDisabled(true); previousCategoryBtn.setDisabled(false);
} }
await interaction.update({ await interaction.update({
@ -124,16 +124,16 @@ export default class extends Command {
} else if(interaction.customID === 'previousCategoryBtn') { } else if(interaction.customID === 'previousCategoryBtn') {
currentPage--; currentPage--;
if(currentPage + 1 !== commandGroups.length) {
nextCategoryBtn.setDisabled(false);
previousCategoryBtn.setDisabled(false);
}
if(currentPage === 0) { if(currentPage === 0) {
previousCategoryBtn.setDisabled(true); previousCategoryBtn.setDisabled(true);
nextCategoryBtn.setDisabled(false); nextCategoryBtn.setDisabled(false);
} }
if(currentPage + 1 !== commandGroups.length) {
nextCategoryBtn.setDisabled(false);
previousCategoryBtn.setDisabled(true);
}
await interaction.update({ await interaction.update({
content: i18next.t('commands:help.helpScreenBtnHelp'), content: i18next.t('commands:help.helpScreenBtnHelp'),
embeds: [commandGroups[currentPage]!.embed], embeds: [commandGroups[currentPage]!.embed],
@ -149,7 +149,7 @@ export default class extends Command {
if(currentPage + 1 !== commandGroups.length) { if(currentPage + 1 !== commandGroups.length) {
nextCategoryBtn.setDisabled(false); nextCategoryBtn.setDisabled(false);
previousCategoryBtn.setDisabled(true); previousCategoryBtn.setDisabled(false);
} }
if(currentPage + 1 === commandGroups.length) { if(currentPage + 1 === commandGroups.length) {
@ -172,6 +172,7 @@ export default class extends Command {
await helpMsg.edit({ await helpMsg.edit({
content: i18next.t('commands:help.helpTimedOut'), content: i18next.t('commands:help.helpTimedOut'),
embeds: [commandGroups[currentPage]!.embed], embeds: [commandGroups[currentPage]!.embed],
components: [],
}); });
}); });
} else { } else {

View file

@ -48,7 +48,7 @@ export default class extends Command {
switch(vmLang.toLowerCase()) { switch(vmLang.toLowerCase()) {
case 'js': case 'js':
case 'javascript': case 'javascript':
await message.reply(i18next.t('commands:vm.computing', { language: 'JavaScript' })); await message.channel.send(i18next.t('commands:vm.computing', { language: 'JavaScript' }));
try { try {
let returnVal: string; let returnVal: string;
@ -57,14 +57,14 @@ export default class extends Command {
else else
returnVal = await javascriptVM.run(`(() => {${code}})()`); returnVal = await javascriptVM.run(`(() => {${code}})()`);
await message.reply(`\`\`\`js\n${returnVal}\`\`\``); await message.channel.send(`\`\`\`js\n${returnVal}\`\`\``);
} catch(err) { } catch(err) {
await message.reply(i18next.t('commands:vm.error', { error: err.message, language: 'JavaScript' })); await message.reply(i18next.t('commands:vm.error', { error: err.message, language: 'JavaScript' }));
} }
break; break;
case 'ts': case 'ts':
case 'typescript': case 'typescript':
await message.reply(i18next.t('commands:vm.computing', { language: 'TypeScript' })); await message.channel.send(i18next.t('commands:vm.computing', { language: 'TypeScript' }));
try { try {
const jsCode = transpile(code); const jsCode = transpile(code);
@ -75,7 +75,7 @@ export default class extends Command {
else else
returnVal = await javascriptVM.run(`(() => {${jsCode}}()`); returnVal = await javascriptVM.run(`(() => {${jsCode}}()`);
await message.reply(`\`\`\`js\n${returnVal}\`\`\``); await message.channel.send(`\`\`\`js\n${returnVal}\`\`\``);
} catch(err) { } catch(err) {
await message.reply(i18next.t('commands:vm.error', { error: err.message, language: 'TypeScript' })); await message.reply(i18next.t('commands:vm.error', { error: err.message, language: 'TypeScript' }));
} }

View file

@ -71,7 +71,8 @@ figlet('Argon Bot', (err, data) => {
}); });
const client = new ArgonClient({ const client = new ArgonClient({
intents: ['GUILDS', 'GUILD_MESSAGES'], intents: ['GUILDS', 'GUILD_MESSAGES', 'DIRECT_MESSAGES'],
partials: ['CHANNEL'],
}); });
client.on('message', async (msg) => { client.on('message', async (msg) => {
@ -138,7 +139,6 @@ client.on('message', async (msg) => {
info(`Finished running ${findCommand.options.name} in ${msg.guild ? msg.guild.name : `${msg.author.username} DMs`}`, ELoggingScope.Command); info(`Finished running ${findCommand.options.name} in ${msg.guild ? msg.guild.name : `${msg.author.username} DMs`}`, ELoggingScope.Command);
msg.channel.stopTyping(); msg.channel.stopTyping();
} catch(e) { } catch(e) {
console.error(e);
error(`An error has occurred while running ${findCommand.options.name}!\n${e.message}`, ELoggingScope.Command); error(`An error has occurred while running ${findCommand.options.name}!\n${e.message}`, ELoggingScope.Command);
await msg.reply(i18next.t('commands:errors.runError', { error: e.message })); await msg.reply(i18next.t('commands:errors.runError', { error: e.message }));
msg.channel.stopTyping(); msg.channel.stopTyping();

View file

@ -18,7 +18,7 @@
"nextCategoryBtn": "Next Category", "nextCategoryBtn": "Next Category",
"previousCategoryBtn": "Previous Category", "previousCategoryBtn": "Previous Category",
"helpTimedOut": "Timed Out", "helpTimedOut": "Timed Out",
"commandDescription": "Name: { $name }\nCategory: { $category }\nDescription: { $description }\nUsage: { $usage }", "commandDescription": "Name: `{ $name }`\nCategory: `{ $category }`\nDescription: `{ $description }`\nUsage: `{ $usage }`",
"categoryPlaceholder": "Choose a category!" "categoryPlaceholder": "Choose a category!"
}, },
"errors": { "errors": {

View file

@ -18,7 +18,7 @@
"nextCategoryBtn": "Nyext Categowy", "nextCategoryBtn": "Nyext Categowy",
"previousCategoryBtn": "Pwevious Categowy", "previousCategoryBtn": "Pwevious Categowy",
"helpTimedOut": "Timed Out", "helpTimedOut": "Timed Out",
"commandDescription": "Nyame: { $name }\nCategowy: { $category }\nDescwiption: { $description }\nUsage: { $usage }", "commandDescription": "Nyame: `{ $name }`\nCategowy: `{ $category }`\nDescwiption: `{ $description }`\nUsage: `{ $usage }`",
"categoryPlaceholder": "Choose a categowy (・`ω´・)" "categoryPlaceholder": "Choose a categowy (・`ω´・)"
}, },
"errors": { "errors": {

141
yarn.lock
View file

@ -929,6 +929,17 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/pg@npm:^8":
version: 8.6.0
resolution: "@types/pg@npm:8.6.0"
dependencies:
"@types/node": "*"
pg-protocol: "*"
pg-types: ^2.2.0
checksum: eef962bbb1838f355efc8789ac6ee5219adb25e49ecd95cf32e374eb9a3caab1f10760d539b400a0c40e21f1a2720e82929a2264b58194fc68cd220627c3b1fc
languageName: node
linkType: hard
"@types/responselike@npm:^1.0.0": "@types/responselike@npm:^1.0.0":
version: 1.0.0 version: 1.0.0
resolution: "@types/responselike@npm:1.0.0" resolution: "@types/responselike@npm:1.0.0"
@ -1361,6 +1372,7 @@ __metadata:
"@types/mocha": ^8.2.2 "@types/mocha": ^8.2.2
"@types/module-alias": ^2.0.0 "@types/module-alias": ^2.0.0
"@types/node": ^15.12.5 "@types/node": ^15.12.5
"@types/pg": ^8
"@types/rimraf": ^3.0.0 "@types/rimraf": ^3.0.0
"@types/sinon": ^10.0.2 "@types/sinon": ^10.0.2
"@types/source-map-support": ^0.5.3 "@types/source-map-support": ^0.5.3
@ -1392,6 +1404,7 @@ __metadata:
node-gyp: ^8.1.0 node-gyp: ^8.1.0
nodemon: ^2.0.8 nodemon: ^2.0.8
nyc: ^15.1.0 nyc: ^15.1.0
pg: ^8.6.0
rimraf: ^3.0.2 rimraf: ^3.0.2
rollup: ^2.52.3 rollup: ^2.52.3
rollup-plugin-multi-input: ^1.3.1 rollup-plugin-multi-input: ^1.3.1
@ -1399,6 +1412,7 @@ __metadata:
sinon: ^11.1.1 sinon: ^11.1.1
sodium: ^3.0.2 sodium: ^3.0.2
source-map-support: ^0.5.19 source-map-support: ^0.5.19
sql-template-strings: ^2.2.2
standard-version: ^9.3.0 standard-version: ^9.3.0
terminal-link: ^3.0.0 terminal-link: ^3.0.0
ts-node: ^10.0.0 ts-node: ^10.0.0
@ -1592,6 +1606,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"buffer-writer@npm:2.0.0":
version: 2.0.0
resolution: "buffer-writer@npm:2.0.0"
checksum: 11736b48bb75106c52ca8ec9f025e7c1b3b25ce31875f469d7210eabd5c576c329e34f6b805d4a8d605ff3f0db1e16342328802c4c963e9c826b0e43a4e631c2
languageName: node
linkType: hard
"bufferutil@npm:^4.0.3": "bufferutil@npm:^4.0.3":
version: 4.0.3 version: 4.0.3
resolution: "bufferutil@npm:4.0.3" resolution: "bufferutil@npm:4.0.3"
@ -5416,6 +5437,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"packet-reader@npm:1.0.0":
version: 1.0.0
resolution: "packet-reader@npm:1.0.0"
checksum: 0b7516f0cbf3e322aad591bed29ba544220088c53943145c0d9121a6f59182ad811f7fd6785a8979a34356aca69d97653689029964c5998dc02645633d88ffd7
languageName: node
linkType: hard
"parent-module@npm:^1.0.0": "parent-module@npm:^1.0.0":
version: 1.0.1 version: 1.0.1
resolution: "parent-module@npm:1.0.1" resolution: "parent-module@npm:1.0.1"
@ -5557,6 +5585,78 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"pg-connection-string@npm:^2.5.0":
version: 2.5.0
resolution: "pg-connection-string@npm:2.5.0"
checksum: a6f3a068f7c9416a5b33a326811caf0dfaaee045c225b7c628b4c9b4e9a2b25bdd12a21e4c48940e1000ea223a4e608ca122d2ff3dd08c8b1db0fc9f5705133a
languageName: node
linkType: hard
"pg-int8@npm:1.0.1":
version: 1.0.1
resolution: "pg-int8@npm:1.0.1"
checksum: a1e3a05a69005ddb73e5f324b6b4e689868a447c5fa280b44cd4d04e6916a344ac289e0b8d2695d66e8e89a7fba023affb9e0e94778770ada5df43f003d664c9
languageName: node
linkType: hard
"pg-pool@npm:^3.3.0":
version: 3.3.0
resolution: "pg-pool@npm:3.3.0"
peerDependencies:
pg: ">=8.0"
checksum: f85cef5b3f40005c4ab06be0d985447c1518fd90b2f0436e5855a6c95b1c0033f3f9d40cd2b27b10a690fb2a09255828ecc9f6ec44644d01a7388a1efa42f6ed
languageName: node
linkType: hard
"pg-protocol@npm:*, pg-protocol@npm:^1.5.0":
version: 1.5.0
resolution: "pg-protocol@npm:1.5.0"
checksum: b839d12cafe942ef9cbc5b13c174eb2356804fb4fe8ead8279f46a36be90722d19a91409955beb8a3d5301639c44854e49749de4aef02dc361fee3e2a61fb1e4
languageName: node
linkType: hard
"pg-types@npm:^2.1.0, pg-types@npm:^2.2.0":
version: 2.2.0
resolution: "pg-types@npm:2.2.0"
dependencies:
pg-int8: 1.0.1
postgres-array: ~2.0.0
postgres-bytea: ~1.0.0
postgres-date: ~1.0.4
postgres-interval: ^1.1.0
checksum: bf4ec3f594743442857fb3a8dfe5d2478a04c98f96a0a47365014557cbc0b4b0cee01462c79adca863b93befbf88f876299b75b72c665b5fb84a2c94fbd10316
languageName: node
linkType: hard
"pg@npm:^8.6.0":
version: 8.6.0
resolution: "pg@npm:8.6.0"
dependencies:
buffer-writer: 2.0.0
packet-reader: 1.0.0
pg-connection-string: ^2.5.0
pg-pool: ^3.3.0
pg-protocol: ^1.5.0
pg-types: ^2.1.0
pgpass: 1.x
peerDependencies:
pg-native: ">=2.0.0"
peerDependenciesMeta:
pg-native:
optional: true
checksum: 37d5d656bf827409c33b3f44cbefc2a435238252f69dfae38112dc35c191090194ab2d5b221ae7b8dc9beed24c71f7f8a97f891130272c6db831d2f9f689d07c
languageName: node
linkType: hard
"pgpass@npm:1.x":
version: 1.0.4
resolution: "pgpass@npm:1.0.4"
dependencies:
split2: ^3.1.1
checksum: ea4751e9ecf345f1e1deccec761a28576eb9f2775a4689e61f5c010a9a812defdd06043918dcb99ebcb503f57bfce33fe34890b12011629d2fba859c21aa2fed
languageName: node
linkType: hard
"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.2.2, picomatch@npm:^2.2.3": "picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.2.2, picomatch@npm:^2.2.3":
version: 2.3.0 version: 2.3.0
resolution: "picomatch@npm:2.3.0" resolution: "picomatch@npm:2.3.0"
@ -5621,6 +5721,36 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"postgres-array@npm:~2.0.0":
version: 2.0.0
resolution: "postgres-array@npm:2.0.0"
checksum: 0e1e659888147c5de579d229a2d95c0d83ebdbffc2b9396d890a123557708c3b758a0a97ed305ce7f58edfa961fa9f0bbcd1ea9f08b6e5df73322e683883c464
languageName: node
linkType: hard
"postgres-bytea@npm:~1.0.0":
version: 1.0.0
resolution: "postgres-bytea@npm:1.0.0"
checksum: d844ae4ca7a941b70e45cac1261a73ee8ed39d72d3d74ab1d645248185a1b7f0ac91a3c63d6159441020f4e1f7fe64689ac56536a307b31cef361e5187335090
languageName: node
linkType: hard
"postgres-date@npm:~1.0.4":
version: 1.0.7
resolution: "postgres-date@npm:1.0.7"
checksum: 5745001d47e51cd767e46bcb1710649cd705d91a24d42fa661c454b6dcbb7353c066a5047983c90a626cd3bbfea9e626cc6fa84a35ec57e5bbb28b49f78e13ed
languageName: node
linkType: hard
"postgres-interval@npm:^1.1.0":
version: 1.2.0
resolution: "postgres-interval@npm:1.2.0"
dependencies:
xtend: ^4.0.0
checksum: 746b71f93805ae33b03528e429dc624706d1f9b20ee81bf743263efb6a0cd79ae02a642a8a480dbc0f09547b4315ab7df6ce5ec0be77ed700bac42730f5c76b2
languageName: node
linkType: hard
"prelude-ls@npm:^1.2.1": "prelude-ls@npm:^1.2.1":
version: 1.2.1 version: 1.2.1
resolution: "prelude-ls@npm:1.2.1" resolution: "prelude-ls@npm:1.2.1"
@ -6463,7 +6593,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"split2@npm:^3.0.0": "split2@npm:^3.0.0, split2@npm:^3.1.1":
version: 3.2.2 version: 3.2.2
resolution: "split2@npm:3.2.2" resolution: "split2@npm:3.2.2"
dependencies: dependencies:
@ -6488,6 +6618,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"sql-template-strings@npm:^2.2.2":
version: 2.2.2
resolution: "sql-template-strings@npm:2.2.2"
checksum: 8155143269134564e9f13203b51da965d7c24dab25278fbd028f2dd2e03aec48d77931f7100245d04b6e3a90c4cf131575c852adf6c91a405e30c8869e055c52
languageName: node
linkType: hard
"ssri@npm:^8.0.0, ssri@npm:^8.0.1": "ssri@npm:^8.0.0, ssri@npm:^8.0.1":
version: 8.0.1 version: 8.0.1
resolution: "ssri@npm:8.0.1" resolution: "ssri@npm:8.0.1"
@ -7416,7 +7553,7 @@ typescript@^4.3.4:
languageName: node languageName: node
linkType: hard linkType: hard
"xtend@npm:~4.0.1": "xtend@npm:^4.0.0, xtend@npm:~4.0.1":
version: 4.0.2 version: 4.0.2
resolution: "xtend@npm:4.0.2" resolution: "xtend@npm:4.0.2"
checksum: ac5dfa738b21f6e7f0dd6e65e1b3155036d68104e67e5d5d1bde74892e327d7e5636a076f625599dc394330a731861e87343ff184b0047fef1360a7ec0a5a36a checksum: ac5dfa738b21f6e7f0dd6e65e1b3155036d68104e67e5d5d1bde74892e327d7e5636a076f625599dc394330a731861e87343ff184b0047fef1360a7ec0a5a36a