diff --git a/src/class/Client.ts b/src/class/Client.ts index 150a538..f74c2a3 100644 --- a/src/class/Client.ts +++ b/src/class/Client.ts @@ -200,7 +200,7 @@ export default class Client extends eris.Client { const interaction = new Int(this); // eslint-disable-next-line no-await-in-loop const c = await this.createGuildCommand(this.config.guildID, interaction.serializeData()); - this.interactions.add(c.application_id, interaction); + this.interactions.add(c.id, interaction); this.util.signale.success(`Successfully loaded interaction: ${interaction.name}`); } } diff --git a/src/commands/index.ts b/src/commands/index.ts index 0ad1e12..42a2093 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -47,7 +47,6 @@ export { default as sss } from './sss'; export { default as stats } from './stats'; export { default as storemessages } from './storemessages'; export { default as sysinfo } from './sysinfo'; -export { default as train } from './train'; export { default as tts } from './tts'; export { default as unban } from './unban'; export { default as unmute } from './unmute'; diff --git a/src/commands/page.ts b/src/commands/page.ts index 4915263..5e20cc9 100644 --- a/src/commands/page.ts +++ b/src/commands/page.ts @@ -185,7 +185,7 @@ export default class Page extends Command { }); } - for (const id of recipientEntry.discordIDs) { + /* for (const id of recipientEntry.discordIDs) { const pager = await this.client.db.PagerNumber.findOne({ individualAssignID: id }); if (!pager || !pager.receivePhone) continue; const member = await this.client.db.Staff.findOne({ userID: pager.individualAssignID }); @@ -229,7 +229,7 @@ export default class Page extends Command { } catch (err) { this.client.util.signale.log(`Unable to Dial ${member.extension} | ${err}`); } - } + } */ this.client.db.Stat.updateOne({ name: 'pages' }, { $inc: { value: 1 } }).exec(); return { status: true, message: `Page to \`${recipientNumber}\` sent.` }; } catch (err) { diff --git a/src/events/InteractionCommandHandler.ts b/src/events/InteractionCommandHandler.ts index e30e6f2..1a55be0 100644 --- a/src/events/InteractionCommandHandler.ts +++ b/src/events/InteractionCommandHandler.ts @@ -12,13 +12,15 @@ export default class InteractionCommandHandler extends Event { public async run(interaction: CommandInteraction) { try { - const int = this.client.interactions.get(interaction.applicationID); + console.log(interaction); + const int = this.client.interactions.get(interaction.id); + if (!int) return; if (!int.checkPermissions(this.client.util.resolveMember(interaction.member?.id, this.client.guilds.get(this.client.config.guildID)))) return; // this.client.util.signale.log(`User '${message.author.username}#${message.author.discriminator}' ran interaction '${resolved.cmd.name}' in '${message.channel.id}'.`); await int.run(interaction); this.client.db.Stat.updateOne({ name: 'commands' }, { $inc: { value: 1 } }).exec(); } catch (err) { - this.client.util.handleError(err, message); + this.client.util.handleError(err); } } } diff --git a/src/events/index.ts b/src/events/index.ts index 973913e..4329656 100644 --- a/src/events/index.ts +++ b/src/events/index.ts @@ -2,5 +2,6 @@ export { default as CallBackHandler } from './CallBackHandler'; export { default as CommandHandler } from './CommandHandler'; export { default as guildMemberAdd } from './guildMemberAdd'; export { default as guildMemberUpdate } from './guildMemberUpdate'; +export { default as InteractionCommandHandler } from './InteractionCommandHandler'; export { default as messageReactionAdd } from './messageReactionAdd'; export { default as ready } from './ready'; diff --git a/src/main.ts b/src/main.ts index 428b834..de6faf0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -24,7 +24,9 @@ async function main(): Promise { client.loadPlugins(); await client.loadEvents(eventFiles); await client.loadCommands(commandFiles); - await client.loadInteractions(interactionFiles); + client.once('ready', async () => { + await client.loadInteractions(interactionFiles); + }); client.connect(); } diff --git a/src/models/Judgement.ts b/src/models/Judgement.ts index 8c14def..764f970 100644 --- a/src/models/Judgement.ts +++ b/src/models/Judgement.ts @@ -1,5 +1,3 @@ -<<<<<<< Updated upstream -<<<<<<< Updated upstream /* eslint-disable no-shadow */ import { Document, Schema, model } from 'mongoose'; @@ -35,44 +33,3 @@ const Judgement: Schema = new Schema({ }); export default model('Judgement', Judgement); -======= -======= ->>>>>>> Stashed changes -import { Document, Schema, model } from 'mongoose'; - -enum Severity { - LOW, - MEDIUM, - HIGH, -} - -export interface JudgementInterface extends Document { - jid: string, - userID: string, - enteredBy: string, - /** - * - 0: LOW - * - 1: MEDIUM - * - 2: HIGH - */ - severity: Severity, - date: Date, - expires: Date | null | undefined, - description: string, -} - -const Judgement: Schema = new Schema({ - jid: String, - userID: String, - enteredBy: String, - severity: Number, - date: Date, - expires: Date, - description: String, -}); - -export default model('Judgement', Judgement); -<<<<<<< Updated upstream ->>>>>>> Stashed changes -======= ->>>>>>> Stashed changes