Merge remote-tracking branch 'origin/dev' into dev

dev
Matthew 2023-02-16 13:22:49 -05:00
commit ae9be3ae11
7 changed files with 14 additions and 14 deletions

View File

@ -5,7 +5,7 @@
import PhoneNumber from 'awesome-phonenumber'; import PhoneNumber from 'awesome-phonenumber';
import axios from 'axios'; import axios from 'axios';
import { Message, TextChannel } from 'eris'; import { Message, TextChannel } from 'eris';
import { Client, Command, RichEmbed } from '../class'; import { Client, CmdContext, Command, RichEmbed } from '../class';
export default class Callback extends Command { export default class Callback extends Command {
constructor(client: Client) { constructor(client: Client) {
@ -19,7 +19,7 @@ export default class Callback extends Command {
this.enabled = false; this.enabled = false;
} }
public async run(message: Message, args: string[]) { public async run(ctx: CmdContext) {
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
if (message.channel.type === 0) await message.delete(); if (message.channel.type === 0) await message.delete();
const member = this.mainGuild.members.get(message.author.id); const member = this.mainGuild.members.get(message.author.id);

View File

@ -3,7 +3,7 @@
*/ */
/* eslint-disable prefer-destructuring */ /* eslint-disable prefer-destructuring */
import { Activity, Member, Message } from 'eris'; import { Activity, Member, Message } from 'eris';
import { Client, Command, RichEmbed } from '../class'; import { Client, CmdContext, Command, RichEmbed } from '../class';
// eslint-disable-next-line no-shadow // eslint-disable-next-line no-shadow
enum ActivityType { enum ActivityType {
@ -26,7 +26,7 @@ export default class Game extends Command {
this.enabled = false; this.enabled = false;
} }
public async run(message: Message, args: string[]) { public async run(ctx: CmdContext) {
let member: Member; let member: Member;
if (!args[0]) member = message.member; if (!args[0]) member = message.member;
else { else {

View File

@ -3,7 +3,7 @@
*/ */
import { Message } from 'eris'; import { Message } from 'eris';
import { Client, Command } from '../class'; import { Client, CmdContext, Command } from '../class';
import { Misc as MiscPBXActions } from '../pbx'; import { Misc as MiscPBXActions } from '../pbx';
export default class Intercom extends Command { export default class Intercom extends Command {
@ -17,7 +17,7 @@ export default class Intercom extends Command {
this.enabled = false; this.enabled = false;
} }
public async run(message: Message, args: string[]) { public async run(ctx: CmdContext) {
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
const loading = await this.loading(message.channel, 'Synthesizing text...'); const loading = await this.loading(message.channel, 'Synthesizing text...');

View File

@ -5,7 +5,7 @@
/* eslint-disable default-case */ /* eslint-disable default-case */
import jwt from 'jsonwebtoken'; import jwt from 'jsonwebtoken';
import { Message } from 'eris'; import { Message } from 'eris';
import { Client, Command } from '../class'; import { Client, CmdContext, Command } from '../class';
export default class Offer extends Command { export default class Offer extends Command {
constructor(client: Client) { constructor(client: Client) {
@ -19,7 +19,7 @@ export default class Offer extends Command {
this.enabled = false; this.enabled = false;
} }
public async run(message: Message, args: string[]) { public async run(ctx: CmdContext) {
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
const member = this.client.util.resolveMember(args[0], this.mainGuild); const member = this.client.util.resolveMember(args[0], this.mainGuild);
if (!member) return this.error(message.channel, 'Could not find member.'); if (!member) return this.error(message.channel, 'Could not find member.');

View File

@ -4,7 +4,7 @@
import { Message, GuildTextableChannel } from 'eris'; import { Message, GuildTextableChannel } from 'eris';
import moment, { unitOfTime } from 'moment'; import moment, { unitOfTime } from 'moment';
import { Client, Command } from '../class'; import { Client, CmdContext, Command } from '../class';
export default class Slowmode extends Command { export default class Slowmode extends Command {
regex: RegExp; regex: RegExp;
@ -20,7 +20,7 @@ export default class Slowmode extends Command {
this.regex = /[a-z]+|[^a-z]+/gi; this.regex = /[a-z]+|[^a-z]+/gi;
} }
public async run(message: Message<GuildTextableChannel>, args: string[]) { public async run(ctx: CmdContext) {
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
const [length, unit] = args[0].match(this.regex); const [length, unit] = args[0].match(this.regex);

View File

@ -4,7 +4,7 @@
import { Message } from 'eris'; import { Message } from 'eris';
import { apply as Apply } from '.'; import { apply as Apply } from '.';
import { Client, Command } from '../class'; import { Client, CmdContext, Command } from '../class';
export default class SSS_Create_Account extends Command { export default class SSS_Create_Account extends Command {
public applyCommand: Apply; public applyCommand: Apply;
@ -19,7 +19,7 @@ export default class SSS_Create_Account extends Command {
this.enabled = false; this.enabled = false;
} }
public async run(message: Message) { public async run(ctx: CmdContext) {
try { try {
const staff = await this.client.db.mongo.Staff.findOne({ userID: message.author.id }).lean().exec(); const staff = await this.client.db.mongo.Staff.findOne({ userID: message.author.id }).lean().exec();
if (!staff) return this.error(message.channel, 'Staff information not located.'); if (!staff) return this.error(message.channel, 'Staff information not located.');

View File

@ -4,7 +4,7 @@
import { randomBytes } from 'crypto'; import { randomBytes } from 'crypto';
import { Message, TextChannel } from 'eris'; import { Message, TextChannel } from 'eris';
import { Client, Command, LocalStorage } from '../class'; import { Client, CmdContext, Command, LocalStorage } from '../class';
export default class StoreMessages extends Command { export default class StoreMessages extends Command {
constructor(client: Client) { constructor(client: Client) {
@ -18,7 +18,7 @@ export default class StoreMessages extends Command {
this.enabled = false; this.enabled = false;
} }
public async run(message: Message, args: string[]) { public async run(ctx: CmdContext) {
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
const check = this.client.util.resolveGuildChannel(args[0], this.mainGuild, false); const check = this.client.util.resolveGuildChannel(args[0], this.mainGuild, false);
if (!check || check.type !== 0) return this.error(message.channel, 'The channel you specified either doesn\'t exist or isn\'t a textable guild channel.'); if (!check || check.type !== 0) return this.error(message.channel, 'The channel you specified either doesn\'t exist or isn\'t a textable guild channel.');