1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 00:10:58 -05:00

Remove unused command

This commit is contained in:
toast-ts 2024-01-14 19:06:27 +11:00
parent 09afcc80a6
commit 9f8976cd07
5 changed files with 3 additions and 75 deletions

View File

@ -11,7 +11,7 @@ import ConfigHelper from './helpers/ConfigHelper.js';
import {readdirSync} from 'node:fs';
import {Config} from 'src/interfaces';
import {
DailyMsgsSvc, UserLevelsSvc, BonkCountSvc,
DailyMsgsSvc, UserLevelsSvc,
MPServerSvc, PunishmentsSvc, ProhibitedWordsSvc,
SuggestionsSvc, TagSystemSvc, YouTubeChannelsSvc
} from './models/IMPORTS.js';
@ -30,7 +30,6 @@ export default class TClient extends Discord.Client {
public dailyMsgs: DailyMsgsSvc = new DailyMsgsSvc();
public userLevels: UserLevelsSvc = new UserLevelsSvc(this);
public punishments: PunishmentsSvc = new PunishmentsSvc(this);
public bonkCount: BonkCountSvc = new BonkCountSvc();
public prohibitedWords: ProhibitedWordsSvc = new ProhibitedWordsSvc();
public MPServer: MPServerSvc = new MPServerSvc();
public suggestions: SuggestionsSvc = new SuggestionsSvc();

View File

@ -1,27 +0,0 @@
import Discord from 'discord.js';
import TClient from '../client.js';
export default class Bonk {
static async run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){
//if (!client.isStaff(interaction.member) && interaction.channelId == '468835415093411863') return interaction.reply('This command is restricted to staff only in this channel due to high usage.')
const member = interaction.options.getMember('member') as Discord.GuildMember;
const reason = interaction.options.getString('reason');
if (member.permissions.has('Administrator')) return interaction.reply('You cannot bonk an admin!');
await client.bonkCount.hitCountIncremental(member.id);
interaction.reply({embeds: [new client.embed().setColor(client.config.embedColor)
.setDescription(`> <@${member.id}> has been bonked!\n${reason?.length == null ? '' : `> Reason: **${reason}**`}`)
.setImage('https://media.tenor.com/7tRddlNUNNcAAAAd/hammer-on-head-minions.gif')
.setFooter({text: `Bonk count for ${member.displayName}: ${await client.bonkCount.fetchUser(member.id).then(x=>x.count)}`})
]})
}
static data = new Discord.SlashCommandBuilder()
.setName('bonk')
.setDescription('Bonk a member')
.addUserOption(x=>x
.setName('member')
.setDescription('Which member to bonk?')
.setRequired(true))
.addStringOption(x=>x
.setName('reason')
.setDescription('Reason for the bonk'))
}

View File

@ -1,12 +1,12 @@
import Discord from 'discord.js';
import TClient from '../client.js';
import Punish from '../components/Punish.js';
export default class Reminder {
export default class Remind {
static run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){
Punish(client, interaction, 'remind');
}
static data = new Discord.SlashCommandBuilder()
.setName('reminder')
.setName('remind')
.setDescription('Remind a member that they\'re breaking the rules')
.addUserOption(x=>x
.setName('member')

View File

@ -1,6 +1,5 @@
export * from './MPServer.js';
export * from './dailyMsgs.js';
export * from './bonkCount.js';
export * from './userLevels.js';
export * from './punishments.js';
export * from './prohibitedWords.js';

View File

@ -1,43 +0,0 @@
import DatabaseServer from '../components/DatabaseServer.js';
import {Model, DataTypes} from 'sequelize';
class bonkCount extends Model {
declare public id: string;
declare public count: number;
}
export class BonkCountSvc {
private model: typeof bonkCount;
constructor(){
this.model = bonkCount;
this.model.init({
id: {
type: DataTypes.STRING,
unique: true,
primaryKey: true
},
count: {
type: DataTypes.INTEGER,
allowNull: false,
}
}, {
tableName: 'bonkcount',
createdAt: false,
updatedAt: false,
sequelize: DatabaseServer.seq
});
this.model.sync();
}
async hitCountIncremental(userId:string) {
const getUser = await this.model.findByPk(userId);
if (getUser) getUser.increment('count');
else await this.model.create({id: userId, count: 1});
return this;
}
async fetchUser(userId:string) {
const getUser = await this.model.findByPk(userId);
if (getUser) return getUser.dataValues;
else return 0;
}
}