disclosure command

This commit is contained in:
Atridad Lahiji 2023-06-29 21:29:33 -06:00
parent 4b048d8982
commit 5445e67468
No known key found for this signature in database

View file

@ -0,0 +1,38 @@
import { ApplyOptions } from '@sapphire/decorators';
import { Command } from '@sapphire/framework';
import { Message } from 'discord.js';
@ApplyOptions<Command.Options>({
description: 'Disclosures for privacy.'
})
export class UserCommand extends Command {
// Register Chat Input and Context Menu command
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand((builder) =>
builder //
.setName(this.name)
.setDescription(this.description)
);
}
// Message command
public async messageRun(message: Message) {
return this.sendDisclosure(message);
}
// Chat Input (slash) command
public async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
return this.sendDisclosure(interaction);
}
private async sendDisclosure(interactionOrMessage: Message | Command.ChatInputCommandInteraction | Command.ContextMenuCommandInteraction) {
interactionOrMessage instanceof Message
? await interactionOrMessage.channel.send({
content: `Commands such as /ask and /pic do not send your discord data to the AI providers. They will, however, send anything you include in the prompts. /ask uses OpenAI's gpt3.5 model and /pic uses Stable Diffusion. All other commands and the data associated stays with HimBot's server and Discord's Servers.`
})
: await interactionOrMessage.reply({
content: `Commands such as /ask and /pic do not send your discord data to the AI providers. They will, however, send anything you include in the prompts. /ask uses OpenAI's gpt3.5 model and /pic uses Stable Diffusion. All other commands and the data associated stays with HimBot's server and Discord's Servers.`,
fetchReply: true
});
}
}