* added message style command * docker setup scripts * reformat messageStyle.ts * fix: register unregister on deploy * add: messageStream preference * add: json config handler * update: messageCreate gets config * update: shifted chat to config callback * fix: naming conventions based on discord * update: setup in docs now * add: static docker ips * version increment * add: bot message for no config * fix: no config case * add: clarification for subnetting * update: version increment in lock file --------- Co-authored-by: JT2M0L3Y <jtsmoley@icloud.com>
19 lines
719 B
TypeScript
19 lines
719 B
TypeScript
import { event, Events } from '../utils/index.js'
|
|
import commands from '../commands/index.js'
|
|
|
|
/**
|
|
* Interaction creation listener for the client
|
|
* @param interaction the interaction received from the server
|
|
*/
|
|
export default event(Events.InteractionCreate, async ({ log, client }, interaction) => {
|
|
if (!interaction.isCommand() || !interaction.isChatInputCommand()) return
|
|
|
|
log(`Interaction called \'${interaction.commandName}\' from ${interaction.user.tag}.`)
|
|
|
|
// ensure command exists, otherwise kill event
|
|
const command = commands.find(command => command.name === interaction.commandName)
|
|
if (!command) return
|
|
|
|
// the command exists, execute it
|
|
command.run(client, interaction)
|
|
}) |