Pull and Switch Model Revised (#142)

* Update: pull-model only runnable by admins now

* Update: switch-model cannot pull models anymore

* Update: less technical responses

* Update: version increment
This commit is contained in:
Kevin Dang
2024-12-04 21:29:01 -08:00
committed by GitHub
parent 1c8449d578
commit d570a50d46
12 changed files with 52 additions and 62 deletions

View File

@@ -1,9 +1,9 @@
import { ChannelType, Client, CommandInteraction, ApplicationCommandOptionType } from 'discord.js'
import { Client, CommandInteraction, ApplicationCommandOptionType } from 'discord.js'
import { AdminCommand, openConfig, SlashCommand } from '../utils/index.js'
export const Disable: SlashCommand = {
name: 'toggle-chat',
description: 'toggle all chat features, Adminstrator Only.',
description: 'toggle all chat features. Adminstrator Only.',
// set available user options to pass to the command
options: [
@@ -24,7 +24,7 @@ export const Disable: SlashCommand = {
// check if runner is an admin
if (!interaction.memberPermissions?.has('Administrator')) {
interaction.reply({
content: `${interaction.commandName} is an Administrator Command.\n\nYou, ${interaction.member?.user.username}, are not an Administrator in this server.\nPlease contact an admin to use this command.`,
content: `${interaction.commandName} is an admin command.\n\nPlease contact an admin to use this command for you.`,
ephemeral: true
})
return
@@ -34,7 +34,7 @@ export const Disable: SlashCommand = {
openConfig(`${interaction.guildId}-config.json`, interaction.commandName, interaction.options.get('enabled')?.value)
interaction.reply({
content: `Chat features has been \`${interaction.options.get('enabled')?.value ? "enabled" : "disabled" }\``,
content: `${client.user?.username} is now **${interaction.options.get('enabled')?.value ? "enabled" : "disabled" }**.`,
ephemeral: true
})
}