diff options
| author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-31 19:20:39 -0500 |
|---|---|---|
| committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-31 19:20:39 -0500 |
| commit | bab76f38a17c62f8c1477172fe1bc9428efb3843 (patch) | |
| tree | 9aee5ed7b54e74735ff417820427c9d2efa984f4 | |
| parent | 78ab3362a52578d0bcada903732f147747c609df (diff) | |
| download | tanzanite-bab76f38a17c62f8c1477172fe1bc9428efb3843.tar.gz tanzanite-bab76f38a17c62f8c1477172fe1bc9428efb3843.tar.bz2 tanzanite-bab76f38a17c62f8c1477172fe1bc9428efb3843.zip | |
fixes, and breaking changes
104 files changed, 627 insertions, 542 deletions
diff --git a/package.json b/package.json index 786a3d7..ea8c3fc 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,13 @@ "repository": "https://github.com/NotEnoughUpdates/bush-bot-3.0", "author": "IRONM00N#0001 (@IRONM00N)", "contributors": [ + "jani270#0119 (@jani270)", "Tyman#5998 (@TymanWasTaken)", "TrashCan#8913 (@TrashCan69420)", "tricked#3777 (@Tricked-dev)", "rioho#0001 (@riohorealhk)", "Proudmuslim#2900 (@proudmuslim-dev)", "katherine🌺#0668 (@Lisenaaaa)", - "jani270#0119 (@jani270)", "pjones123#6025 (@pjones123)", "Angry_Pineapple#6926 (@Angry-Pineapple3121)", "EthanDevelops#5366 (@EthanDevelops)" @@ -44,7 +44,7 @@ "format:check": "yarn prettier . --check", "upgrade": "yarn rimraf yarn.lock && yarn cache clean && yarn install && yarn up && yarn up -R && yarn set version latest", "upgrade:sdk": "yarn dlx @yarnpkg/sdks vscode", - "upgrade:manual": "yarn add @notenoughupdates/discord.js-minesweeper @notenoughupdates/events-intercept @notenoughupdates/humanize-duration @notenoughupdates/simplify-number @notenoughupdates/wolfram-alpha-api @sentry/integrations @sentry/node @sentry/tracing canvas deep-lock chalk discord-akairo@npm:@notenoughupdates/discord-akairo@dev discord.js@npm:@notenoughupdates/discord.js@dev fuse.js got lodash mathjs moment nanoid node-os-utils numeral pg pg-hstore prettier pretty-bytes rimraf sequelize source-map-support tinycolor2 tslib typescript vm2 && yarn add --dev @types/express @types/lodash @types/node @types/node-os-utils @types/numeral @types/tinycolor2 @types/validator @typescript-eslint/eslint-plugin @typescript-eslint/parser discord-api-types@0.26.0 eslint eslint-config-prettier", + "upgrade:manual": "yarn add @notenoughupdates/discord.js-minesweeper @notenoughupdates/events-intercept @notenoughupdates/humanize-duration @notenoughupdates/simplify-number @notenoughupdates/wolfram-alpha-api @sentry/integrations @sentry/node @sentry/tracing canvas chalk deep-lock discord-akairo@npm:@notenoughupdates/discord-akairo@dev discord.js@npm:@notenoughupdates/discord.js@dev fuse.js got lodash mathjs moment nanoid node-os-utils numeral pg pg-hstore prettier pretty-bytes rimraf sequelize source-map-support tinycolor2 tslib typescript vm2 && yarn add --dev @types/express @types/lodash @types/node @types/node-os-utils @types/numeral @types/tinycolor2 @types/validator @typescript-eslint/eslint-plugin @typescript-eslint/parser discord-api-types@0.26.1 eslint eslint-config-prettier node-fetch", "upgrade:package": "powershell -c \"yarn info --name-only | %{\\$_ -replace '^(?:├─ |└─ )?(@?[a-z0-9-~][a-z0-9-._~/]{0,}(?=.*(npm:(?!.*dev)|patch:.*?@npm).*))|.*\\$','\\$1'} | where{[string]::IsNullOrEmpty(\\$_) -eq \\$false} | yarn add\"", "beta": "git push && git checkout beta && git merge master && git push && git checkout master", "deploy:beta": "pm2 deploy ecosystem.config.cjs beta", @@ -57,9 +57,9 @@ "@notenoughupdates/humanize-duration": "^4.0.1", "@notenoughupdates/simplify-number": "^1.0.1", "@notenoughupdates/wolfram-alpha-api": "^1.0.1", - "@sentry/integrations": "^6.16.1", - "@sentry/node": "^6.16.1", - "@sentry/tracing": "^6.16.1", + "@sentry/integrations": "^6.17.3", + "@sentry/node": "^6.17.3", + "@sentry/tracing": "^6.17.3", "canvas": "^2.9.0", "chalk": "^5.0.0", "deep-lock": "^1.0.0", @@ -78,18 +78,18 @@ "prettier": "^2.5.1", "pretty-bytes": "^5.6.0", "rimraf": "^3.0.2", - "sequelize": "^6.13.0", + "sequelize": "6.13.0", "source-map-support": "^0.5.21", "tinycolor2": "^1.4.2", "tslib": "^2.3.1", - "typescript": "^4.5.4", + "typescript": "^4.5.5", "vm2": "^3.9.5" }, "devDependencies": { "@types/eslint": "^8", "@types/express": "^4.17.13", "@types/lodash": "^4.14.178", - "@types/node": "^17.0.10", + "@types/node": "^17.0.13", "@types/node-os-utils": "^1.2.0", "@types/numeral": "^2.0.2", "@types/pg": "^8", @@ -98,12 +98,13 @@ "@types/source-map-support": "^0", "@types/tinycolor2": "^1.4.3", "@types/validator": "^13.7.1", - "@typescript-eslint/eslint-plugin": "^5.10.0", - "@typescript-eslint/parser": "^5.10.0", + "@typescript-eslint/eslint-plugin": "^5.10.2", + "@typescript-eslint/parser": "^5.10.2", "discord-api-types": "0.26.1", - "eslint": "^8.7.0", + "eslint": "^8.8.0", "eslint-config-prettier": "^8.3.0", - "eslint-plugin-deprecation": "^1.3.2" + "eslint-plugin-deprecation": "^1.3.2", + "node-fetch": "^3.2.0" }, "packageManager": "yarn@3.1.1" } diff --git a/src/arguments/permission.ts b/src/arguments/permission.ts index 4ae6327..cf4c42c 100644 --- a/src/arguments/permission.ts +++ b/src/arguments/permission.ts @@ -1,12 +1,12 @@ import { type BushArgumentTypeCaster } from '#lib'; -import { Permissions, type PermissionString } from 'discord.js'; +import { PermissionFlagsBits, type PermissionsString } from 'discord.js'; -export const permission: BushArgumentTypeCaster<PermissionString | null> = (_, phrase) => { +export const permission: BushArgumentTypeCaster<PermissionsString | null> = (_, phrase) => { if (!phrase) return null; phrase = phrase.toUpperCase().replace(/ /g, '_'); - if (!(phrase in Permissions.FLAGS)) { + if (!(phrase in PermissionFlagsBits)) { return null; } else { - return phrase as PermissionString; + return phrase as PermissionsString; } }; diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts index 4f511cd..e12a131 100644 --- a/src/commands/admin/channelPermissions.ts +++ b/src/commands/admin/channelPermissions.ts @@ -1,5 +1,5 @@ import { BushCommand, ButtonPaginator, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; -import { ApplicationCommandOptionType, Embed, Permissions } from 'discord.js'; +import { ApplicationCommandOptionType, Embed, PermissionFlagsBits } from 'discord.js'; export default class ChannelPermissionsCommand extends BushCommand { public constructor() { @@ -47,8 +47,8 @@ export default class ChannelPermissionsCommand extends BushCommand { ] } ], - clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.MANAGE_CHANNELS]), - userPermissions: [Permissions.FLAGS.ADMINISTRATOR], + clientPermissions: (m) => util.clientSendAndPermCheck(m, [PermissionFlagsBits.ManageChannels]), + userPermissions: [PermissionFlagsBits.Administrator], channel: 'guild', slash: true }); @@ -63,7 +63,7 @@ export default class ChannelPermissionsCommand extends BushCommand { } ) { if (!message.inGuild()) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); - if (!message.member!.permissions.has(Permissions.FLAGS.ADMINISTRATOR) && !message.member!.user.isOwner()) + if (!message.member!.permissions.has(PermissionFlagsBits.Administrator) && !message.member!.user.isOwner()) return await message.util.reply(`${util.emojis.error} You must have admin perms to use this command.`); if (message.util.isSlashMessage(message)) await message.interaction.deferReply(); diff --git a/src/commands/admin/roleAll.ts b/src/commands/admin/roleAll.ts index 3b438d9..c056bbd 100644 --- a/src/commands/admin/roleAll.ts +++ b/src/commands/admin/roleAll.ts @@ -1,5 +1,5 @@ import { AllowedMentions, BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; -import { ApplicationCommandOptionType, Permissions, type GuildMember } from 'discord.js'; +import { ApplicationCommandOptionType, PermissionFlagsBits, type GuildMember } from 'discord.js'; export default class RoleAllCommand extends BushCommand { public constructor() { @@ -30,8 +30,8 @@ export default class RoleAllCommand extends BushCommand { } ], channel: 'guild', - clientPermissions: (m) => util.clientSendAndPermCheck(m, [Permissions.FLAGS.MANAGE_ROLES]), - userPermissions: [Permissions.FLAGS.ADMINISTRATOR], + clientPermissions: (m) => util.clientSendAndPermCheck(m, [PermissionFlagsBits.ManageRoles]), + userPermissions: [PermissionFlagsBits.Administrator], typing: true, slash: true }); @@ -39,7 +39,7 @@ export default class RoleAllCommand extends BushCommand { public override async exec(message: BushMessage | BushSlashMessage, args: { role: ArgType<'role'>; bots: ArgType<'boolean'> }) { if (!message.inGuild()) return await message.util.reply(`${util.emojis.error} This command can only be run in a server.`); - if (!message.member!.permissions.has(Permissions.FLAGS.ADMINISTRATOR) && !message.member!.user.isOwner()) + |
