From edcc0dd0a9228192ff6c4f6d6797dd6238e98f92 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sat, 31 Jul 2021 13:46:27 -0400 Subject: upgraded to typescript 4.3.5 The reason I had to use getters and setters for the db models is because in the newer version of typescript the properties would be defined at runtime and override the getter and setters that sequalize uses later, causing all the values to be undefined and not being able to save any information. --- src/commands/moulberry-bush/capePerms.ts | 2 +- src/commands/moulberry-bush/giveawayPing.ts | 2 +- src/commands/moulberry-bush/level.ts | 2 +- src/commands/moulberry-bush/report.ts | 11 +++++++---- src/commands/moulberry-bush/rule.ts | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src/commands/moulberry-bush') diff --git a/src/commands/moulberry-bush/capePerms.ts b/src/commands/moulberry-bush/capePerms.ts index 7a021ed..eb1ab89 100644 --- a/src/commands/moulberry-bush/capePerms.ts +++ b/src/commands/moulberry-bush/capePerms.ts @@ -37,7 +37,7 @@ export default class CapePermissionsCommand extends BushCommand { }); } - public async exec(message: BushMessage | BushSlashMessage, args: { ign: string }): Promise { + public override async exec(message: BushMessage | BushSlashMessage, args: { ign: string }): Promise { interface Capeperms { success: boolean; perms: User[]; diff --git a/src/commands/moulberry-bush/giveawayPing.ts b/src/commands/moulberry-bush/giveawayPing.ts index 269c33f..4abc6ab 100644 --- a/src/commands/moulberry-bush/giveawayPing.ts +++ b/src/commands/moulberry-bush/giveawayPing.ts @@ -23,7 +23,7 @@ export default class GiveawayPingCommand extends BushCommand { }); } - public async exec(message: BushMessage): Promise { + public override async exec(message: BushMessage): Promise { if (!message.member.permissions.has('MANAGE_GUILD')) await message.util.reply(`${util.emojis.error} You are missing the \`manage server\` permission.`); diff --git a/src/commands/moulberry-bush/level.ts b/src/commands/moulberry-bush/level.ts index 86ab985..fef4538 100644 --- a/src/commands/moulberry-bush/level.ts +++ b/src/commands/moulberry-bush/level.ts @@ -136,7 +136,7 @@ export default class LevelCommand extends BushCommand { } } - async exec(message: BushMessage | BushSlashMessage, { user }: { user?: BushUser }): Promise { + override async exec(message: BushMessage | BushSlashMessage, { user }: { user?: BushUser }): Promise { // await message.reply( // new MessageAttachment( // await this.getImage(user || message.author), diff --git a/src/commands/moulberry-bush/report.ts b/src/commands/moulberry-bush/report.ts index 2ee02bd..e91420b 100644 --- a/src/commands/moulberry-bush/report.ts +++ b/src/commands/moulberry-bush/report.ts @@ -1,6 +1,6 @@ -import { GuildMember, MessageEmbed, TextChannel } from 'discord.js'; +import { GuildMember, MessageEmbed } from 'discord.js'; import moment from 'moment'; -import { AllowedMentions, BushCommand, BushMessage } from '../../lib'; +import { AllowedMentions, BushCommand, BushMessage, BushTextChannel } from '../../lib'; export default class ReportCommand extends BushCommand { public constructor() { @@ -55,7 +55,10 @@ export default class ReportCommand extends BushCommand { }); } - public async exec(message: BushMessage, { member, evidence }: { member: GuildMember; evidence: string }): Promise { + public override async exec( + message: BushMessage, + { member, evidence }: { member: GuildMember; evidence: string } + ): Promise { if (message.guild.id != client.consts.mappings.guilds.bush) return await message.util.reply(`${util.emojis.error} This command can only be run in Moulberry's bush.`); if (!member) return await message.util.reply(`${util.emojis.error} Choose someone to report`); @@ -103,7 +106,7 @@ export default class ReportCommand extends BushCommand { reportEmbed.addField('Attachment', message.attachments.first().url); } } - const reportChannel = client.channels.cache.get('782972723654688848'); + const reportChannel = client.channels.cache.get('782972723654688848') as unknown as BushTextChannel; await reportChannel.send({ embeds: [reportEmbed] }).then(async (ReportMessage) => { try { await ReportMessage.react(util.emojis.success); diff --git a/src/commands/moulberry-bush/rule.ts b/src/commands/moulberry-bush/rule.ts index 41dd8de..eb767a8 100644 --- a/src/commands/moulberry-bush/rule.ts +++ b/src/commands/moulberry-bush/rule.ts @@ -103,7 +103,7 @@ export default class RuleCommand extends BushCommand { }); } - public async exec(message: BushMessage, { rule, user }: { rule: undefined | number; user: User }): Promise { + public override async exec(message: BushMessage, { rule, user }: { rule: undefined | number; user: User }): Promise { const rulesEmbed = new MessageEmbed() .setColor('#ef3929') .setFooter(`Triggered by ${message.author.tag}`, message.author.avatarURL({ dynamic: true })) -- cgit