master
Matthew 2022-02-03 14:39:11 -05:00
parent 58777b51bd
commit 33101429a9
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
7 changed files with 11 additions and 50 deletions

View File

@ -200,7 +200,7 @@ export default class Client extends eris.Client {
const interaction = new Int(this); const interaction = new Int(this);
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
const c = await this.createGuildCommand(this.config.guildID, interaction.serializeData()); 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}`); this.util.signale.success(`Successfully loaded interaction: ${interaction.name}`);
} }
} }

View File

@ -47,7 +47,6 @@ export { default as sss } from './sss';
export { default as stats } from './stats'; export { default as stats } from './stats';
export { default as storemessages } from './storemessages'; export { default as storemessages } from './storemessages';
export { default as sysinfo } from './sysinfo'; export { default as sysinfo } from './sysinfo';
export { default as train } from './train';
export { default as tts } from './tts'; export { default as tts } from './tts';
export { default as unban } from './unban'; export { default as unban } from './unban';
export { default as unmute } from './unmute'; export { default as unmute } from './unmute';

View File

@ -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 }); const pager = await this.client.db.PagerNumber.findOne({ individualAssignID: id });
if (!pager || !pager.receivePhone) continue; if (!pager || !pager.receivePhone) continue;
const member = await this.client.db.Staff.findOne({ userID: pager.individualAssignID }); const member = await this.client.db.Staff.findOne({ userID: pager.individualAssignID });
@ -229,7 +229,7 @@ export default class Page extends Command {
} catch (err) { } catch (err) {
this.client.util.signale.log(`Unable to Dial ${member.extension} | ${err}`); this.client.util.signale.log(`Unable to Dial ${member.extension} | ${err}`);
} }
} } */
this.client.db.Stat.updateOne({ name: 'pages' }, { $inc: { value: 1 } }).exec(); this.client.db.Stat.updateOne({ name: 'pages' }, { $inc: { value: 1 } }).exec();
return { status: true, message: `Page to \`${recipientNumber}\` sent.` }; return { status: true, message: `Page to \`${recipientNumber}\` sent.` };
} catch (err) { } catch (err) {

View File

@ -12,13 +12,15 @@ export default class InteractionCommandHandler extends Event {
public async run(interaction: CommandInteraction) { public async run(interaction: CommandInteraction) {
try { 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; 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}'.`); // 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); await int.run(interaction);
this.client.db.Stat.updateOne({ name: 'commands' }, { $inc: { value: 1 } }).exec(); this.client.db.Stat.updateOne({ name: 'commands' }, { $inc: { value: 1 } }).exec();
} catch (err) { } catch (err) {
this.client.util.handleError(err, message); this.client.util.handleError(err);
} }
} }
} }

View File

@ -2,5 +2,6 @@ export { default as CallBackHandler } from './CallBackHandler';
export { default as CommandHandler } from './CommandHandler'; export { default as CommandHandler } from './CommandHandler';
export { default as guildMemberAdd } from './guildMemberAdd'; export { default as guildMemberAdd } from './guildMemberAdd';
export { default as guildMemberUpdate } from './guildMemberUpdate'; export { default as guildMemberUpdate } from './guildMemberUpdate';
export { default as InteractionCommandHandler } from './InteractionCommandHandler';
export { default as messageReactionAdd } from './messageReactionAdd'; export { default as messageReactionAdd } from './messageReactionAdd';
export { default as ready } from './ready'; export { default as ready } from './ready';

View File

@ -24,7 +24,9 @@ async function main(): Promise<void> {
client.loadPlugins(); client.loadPlugins();
await client.loadEvents(eventFiles); await client.loadEvents(eventFiles);
await client.loadCommands(commandFiles); await client.loadCommands(commandFiles);
await client.loadInteractions(interactionFiles); client.once('ready', async () => {
await client.loadInteractions(interactionFiles);
});
client.connect(); client.connect();
} }

View File

@ -1,5 +1,3 @@
<<<<<<< Updated upstream
<<<<<<< Updated upstream
/* eslint-disable no-shadow */ /* eslint-disable no-shadow */
import { Document, Schema, model } from 'mongoose'; import { Document, Schema, model } from 'mongoose';
@ -35,44 +33,3 @@ const Judgement: Schema = new Schema({
}); });
export default model<JudgementInterface>('Judgement', Judgement); export default model<JudgementInterface>('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<JudgementInterface>('Judgement', Judgement);
<<<<<<< Updated upstream
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes