push new cmds

dev
Matthew 2023-02-15 21:04:34 -05:00
parent bb039360a0
commit 7a1caddcdc
7 changed files with 14 additions and 14 deletions

View File

@ -5,7 +5,7 @@
import PhoneNumber from 'awesome-phonenumber';
import axios from 'axios';
import { Message, TextChannel } from 'eris';
import { Client, Command, RichEmbed } from '../class';
import { Client, CmdContext, Command, RichEmbed } from '../class';
export default class Callback extends Command {
constructor(client: Client) {
@ -19,7 +19,7 @@ export default class Callback extends Command {
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 (message.channel.type === 0) await message.delete();
const member = this.mainGuild.members.get(message.author.id);

View File

@ -3,7 +3,7 @@
*/
/* eslint-disable prefer-destructuring */
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
enum ActivityType {
@ -26,7 +26,7 @@ export default class Game extends Command {
this.enabled = false;
}
public async run(message: Message, args: string[]) {
public async run(ctx: CmdContext) {
let member: Member;
if (!args[0]) member = message.member;
else {

View File

@ -3,7 +3,7 @@
*/
import { Message } from 'eris';
import { Client, Command } from '../class';
import { Client, CmdContext, Command } from '../class';
import { Misc as MiscPBXActions } from '../pbx';
export default class Intercom extends Command {
@ -17,7 +17,7 @@ export default class Intercom extends Command {
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]);
const loading = await this.loading(message.channel, 'Synthesizing text...');

View File

@ -5,7 +5,7 @@
/* eslint-disable default-case */
import jwt from 'jsonwebtoken';
import { Message } from 'eris';
import { Client, Command } from '../class';
import { Client, CmdContext, Command } from '../class';
export default class Offer extends Command {
constructor(client: Client) {
@ -19,7 +19,7 @@ export default class Offer extends Command {
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]);
const member = this.client.util.resolveMember(args[0], this.mainGuild);
if (!member) return this.error(message.channel, 'Could not find member.');

View File

@ -4,7 +4,7 @@
import { Message, GuildTextableChannel } from 'eris';
import moment, { unitOfTime } from 'moment';
import { Client, Command } from '../class';
import { Client, CmdContext, Command } from '../class';
export default class Slowmode extends Command {
regex: RegExp;
@ -20,7 +20,7 @@ export default class Slowmode extends Command {
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]);
const [length, unit] = args[0].match(this.regex);

View File

@ -4,7 +4,7 @@
import { Message } from 'eris';
import { apply as Apply } from '.';
import { Client, Command } from '../class';
import { Client, CmdContext, Command } from '../class';
export default class SSS_Create_Account extends Command {
public applyCommand: Apply;
@ -19,7 +19,7 @@ export default class SSS_Create_Account extends Command {
this.enabled = false;
}
public async run(message: Message) {
public async run(ctx: CmdContext) {
try {
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.');

View File

@ -4,7 +4,7 @@
import { randomBytes } from 'crypto';
import { Message, TextChannel } from 'eris';
import { Client, Command, LocalStorage } from '../class';
import { Client, CmdContext, Command, LocalStorage } from '../class';
export default class StoreMessages extends Command {
constructor(client: Client) {
@ -18,7 +18,7 @@ export default class StoreMessages extends Command {
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]);
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.');