mirror of
https://github.com/pacnpal/markov-discord.git
synced 2025-12-20 11:01:04 -05:00
@@ -1,6 +1,10 @@
|
||||
import { SlashCommandBuilder, SlashCommandChannelOption } from '@discordjs/builders';
|
||||
import { REST } from '@discordjs/rest';
|
||||
import { ChannelType, Routes } from 'discord-api-types/v10';
|
||||
import {
|
||||
SlashCommandChannelOption,
|
||||
SlashCommandBuilder,
|
||||
ChannelType,
|
||||
Routes,
|
||||
REST,
|
||||
} from 'discord.js';
|
||||
import { config } from './config';
|
||||
import { packageJson } from './util';
|
||||
|
||||
@@ -18,21 +22,21 @@ export const messageCommand = new SlashCommandBuilder()
|
||||
.setName(config.slashCommandName)
|
||||
.setDescription('Generate a message from learned past messages')
|
||||
.addBooleanOption((tts) =>
|
||||
tts.setName('tts').setDescription('Read the message via text-to-speech.').setRequired(false)
|
||||
tts.setName('tts').setDescription('Read the message via text-to-speech.').setRequired(false),
|
||||
)
|
||||
.addBooleanOption((debug) =>
|
||||
debug
|
||||
.setName('debug')
|
||||
.setDescription('Follow up the generated message with the detailed sources that inspired it.')
|
||||
.setRequired(false)
|
||||
.setRequired(false),
|
||||
)
|
||||
.addStringOption((seed) =>
|
||||
seed
|
||||
.setName('seed')
|
||||
.setDescription(
|
||||
`A ${config.stateSize}-word phrase to attempt to start a generated sentence with.`
|
||||
`A ${config.stateSize}-word phrase to attempt to start a generated sentence with.`,
|
||||
)
|
||||
.setRequired(false)
|
||||
.setRequired(false),
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -52,10 +56,10 @@ export const listenChannelCommand = new SlashCommandBuilder()
|
||||
sub
|
||||
.setName('add')
|
||||
.setDescription(
|
||||
`Add channels to learn from. Doesn't add the channel's past messages; re-train to do that.`
|
||||
`Add channels to learn from. Doesn't add the channel's past messages; re-train to do that.`,
|
||||
);
|
||||
Array.from(Array(CHANNEL_OPTIONS_MAX).keys()).forEach((index) =>
|
||||
sub.addChannelOption((opt) => channelOptionsGenerator(opt, index))
|
||||
sub.addChannelOption((opt) => channelOptionsGenerator(opt, index)),
|
||||
);
|
||||
return sub;
|
||||
})
|
||||
@@ -63,42 +67,42 @@ export const listenChannelCommand = new SlashCommandBuilder()
|
||||
sub
|
||||
.setName('remove')
|
||||
.setDescription(
|
||||
`Remove channels from being learned from. Doesn't remove the channel's data; re-train to do that.`
|
||||
`Remove channels from being learned from. Doesn't remove the channel's data; re-train to do that.`,
|
||||
);
|
||||
Array.from(Array(CHANNEL_OPTIONS_MAX).keys()).forEach((index) =>
|
||||
sub.addChannelOption((opt) => channelOptionsGenerator(opt, index))
|
||||
sub.addChannelOption((opt) => channelOptionsGenerator(opt, index)),
|
||||
);
|
||||
return sub;
|
||||
})
|
||||
.addSubcommand((sub) =>
|
||||
sub
|
||||
.setName('list')
|
||||
.setDescription(`List the channels the bot is currently actively listening to.`)
|
||||
.setDescription(`List the channels the bot is currently actively listening to.`),
|
||||
)
|
||||
.addSubcommand((sub) =>
|
||||
sub
|
||||
.setName('modify')
|
||||
.setDescription(`Add or remove channels via select menu UI (first 25 text channels only)`)
|
||||
.setDescription(`Add or remove channels via select menu UI (first 25 text channels only)`),
|
||||
);
|
||||
|
||||
export const trainCommand = new SlashCommandBuilder()
|
||||
.setName('train')
|
||||
.setDescription(
|
||||
'Train from past messages from the configured listened channels. This takes a while.'
|
||||
'Train from past messages from the configured listened channels. This takes a while.',
|
||||
)
|
||||
.addBooleanOption((clean) =>
|
||||
clean
|
||||
.setName('clean')
|
||||
.setDescription(
|
||||
'Whether the database should be emptied before training. Default is true (recommended).'
|
||||
'Whether the database should be emptied before training. Default is true (recommended).',
|
||||
)
|
||||
.setRequired(false)
|
||||
.setRequired(false),
|
||||
)
|
||||
.addAttachmentOption((json) =>
|
||||
json
|
||||
.setName('json')
|
||||
.setDescription('Train from a provided JSON file rather than channel history.')
|
||||
.setRequired(false)
|
||||
.setRequired(false),
|
||||
);
|
||||
|
||||
const commands = [
|
||||
|
||||
Reference in New Issue
Block a user