mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 04:10:59 -05:00
Compare commits
2 Commits
f211e75d01
...
a9874faf9a
Author | SHA1 | Date | |
---|---|---|---|
|
a9874faf9a | ||
|
fb85250751 |
@ -2,6 +2,6 @@
|
|||||||
<img width="650" height="240" src="https://cdn.discordapp.com/attachments/1118960531135541318/1151036641717260348/Daggerbot-TS-repo.gif">
|
<img width="650" height="240" src="https://cdn.discordapp.com/attachments/1118960531135541318/1151036641717260348/Daggerbot-TS-repo.gif">
|
||||||
<h1 align="center">Daggerbot-TS Description</h1>
|
<h1 align="center">Daggerbot-TS Description</h1>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
This is a 1st generation bot that is a TypeScript-based Daggerbot converted from JavaScript at <s><a href="https://github.com/SpaceManBuzz/DaggerBot-">SpaceManBuzz/DaggerBot-</a></s> (now archived and privated)
|
This is a 1st generation bot that is a TypeScript-based bot converted from JavaScript at <s><a href="https://github.com/SpaceManBuzz/DaggerBot-">SpaceManBuzz/DaggerBot-</a></s> (now archived and privated)
|
||||||
</p>
|
</p>
|
||||||
</p>
|
</p>
|
||||||
|
@ -51,7 +51,10 @@ export default {
|
|||||||
Response.create(client, message, GeneralChatID, 'afternoon');
|
Response.create(client, message, GeneralChatID, 'afternoon');
|
||||||
Response.create(client, message, GeneralChatID, 'evening');
|
Response.create(client, message, GeneralChatID, 'evening');
|
||||||
Response.create(client, message, GeneralChatID, 'night');
|
Response.create(client, message, GeneralChatID, 'night');
|
||||||
|
|
||||||
CmdTrigger.registerCmds(client, message, '!!_wepanikfrfr');
|
CmdTrigger.registerCmds(client, message, '!!_wepanikfrfr');
|
||||||
|
CmdTrigger.MFPwTrigger(message, '!!_farmpw');
|
||||||
|
CmdTrigger.TriggerTest(message, '!!_test-trigger');
|
||||||
|
|
||||||
if (message.mentions.members.has('309373272594579456') && !client.isStaff(message.member)) message.reply('Please don\'t tag Daggerwin, read rule 14 in <#468846117405196289>');
|
if (message.mentions.members.has('309373272594579456') && !client.isStaff(message.member)) message.reply('Please don\'t tag Daggerwin, read rule 14 in <#468846117405196289>');
|
||||||
if (message.mentions.members.has('215497515934416896') && !client.isStaff(message.member) && message.type != 19) message.reply('Please don\'t tag Monster unless it\'s important!');
|
if (message.mentions.members.has('215497515934416896') && !client.isStaff(message.member) && message.type != 19) message.reply('Please don\'t tag Monster unless it\'s important!');
|
||||||
|
@ -2,11 +2,24 @@ import Discord from 'discord.js';
|
|||||||
import TClient from '../client.js';
|
import TClient from '../client.js';
|
||||||
|
|
||||||
export default class CmdTrigger {
|
export default class CmdTrigger {
|
||||||
|
protected static SenseTrigger(message:Discord.Message, trigger:string) {
|
||||||
|
return message.content.toLowerCase().startsWith(trigger)
|
||||||
|
}
|
||||||
static registerCmds(client:TClient, message:Discord.Message, trigger:string) {
|
static registerCmds(client:TClient, message:Discord.Message, trigger:string) {
|
||||||
if (message.content.startsWith(trigger) && client.config.whitelist.includes(message.author.id)) {
|
if (this.SenseTrigger(message, trigger) && client.config.whitelist.includes(message.author.id)) {
|
||||||
(client.guilds.cache.get(message.guildId) as Discord.Guild).commands.set(client.registry)
|
(client.guilds.cache.get(message.guildId) as Discord.Guild).commands.set(client.registry)
|
||||||
.then(()=>message.reply('How did you manage to lose the commands??? Anyways, it\'s re-registered now.'))
|
.then(()=>message.reply('How did you manage to lose the commands??? Anyways, it\'s re-registered now.'))
|
||||||
.catch((e:Error)=>message.reply(`Failed to deploy slash commands:\n\`\`\`${e.message}\`\`\``));
|
.catch((e:Error)=>message.reply(`Failed to deploy slash commands:\n\`\`\`${e.message}\`\`\``));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static MFPwTrigger(message:Discord.Message, trigger:string) {
|
||||||
|
if (this.SenseTrigger(message, trigger)) {
|
||||||
|
let farmPwText = 'The farm password is ';
|
||||||
|
if (message.channelId === '1149138133514981386') return message.reply(farmPwText += '`westfarm`')
|
||||||
|
else if (message.channelId === '1149138202662293555') return message.reply(farmPwText += '`eastfarm`')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static TriggerTest(message:Discord.Message, trigger:string) {
|
||||||
|
if (this.SenseTrigger(message, trigger)) return message.reply('Triggered!')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user