-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-commands.js
119 lines (115 loc) · 3.74 KB
/
deploy-commands.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
const { SlashCommandBuilder, Routes } = require('discord.js');
const { REST } = require('@discordjs/rest');
const clientId = process.env.DISCORD_BOT_CLIENT_ID;
const guildId = process.env.DISCORD_BOT_GUILD_ID;
const token = process.env.DISCORD_TOKEN;
const commands = [
new SlashCommandBuilder().setName('k9pause').setDescription('Pause TTS queue'),
new SlashCommandBuilder().setName('k9resume').setDescription('Resume TTS queue'),
new SlashCommandBuilder()
.setName('k9tts')
.setDescription('Adds TTS directly to queue')
.addStringOption(option =>
option.setName('message')
.setDescription('A message for K9000 to say via TTS')
.setRequired(true)
),
new SlashCommandBuilder()
.setName('ab')
.setDescription('Adventure Bot commands')
.addSubcommand(subcommand =>
subcommand
.setName('prompt')
.setDescription('submit prompt (only valid during prompt round)')
.addStringOption(option =>
option.setName('prompt')
.setDescription('A prompt for the AI')
.setRequired(true)
)
)
.addSubcommand(subcommand =>
subcommand
.setName('skip')
.setDescription('Skip current TTS (if audio present)')
)
.addSubcommand(subcommand =>
subcommand
.setName('redo')
.setDescription('regenerate the last response(s) (only valid during vote round)')
)
.addSubcommand(subcommand =>
subcommand
.setName('retry')
.setDescription('retry entering the last prompt (only valid during vote round)')
)
.addSubcommand(subcommand =>
subcommand
.setName('continue')
.setDescription('submit empty prompt to continue story (only valid during prompt round)')
)
.addSubcommand(subcommand =>
subcommand
.setName('next')
.setDescription('skip the countdown and advance to the next round')
)
.addSubcommand(subcommand =>
subcommand
.setName('new')
.setDescription('start a new story (saves previous story)')
)
.addSubcommand(subcommand =>
subcommand
.setName('end')
.setDescription('ends the current story & gets a random post-ending (saves story)')
)
.addSubcommand(subcommand =>
subcommand
.setName('start')
.setDescription('start adventure bot game loop')
)
.addSubcommand(subcommand =>
subcommand
.setName('stop')
.setDescription('stop adventure bot game loop')
)
.addSubcommand(subcommand =>
subcommand
.setName('model')
.setDescription('get the current running koboldai model')
)
.addSubcommand(subcommand =>
subcommand
.setName('join')
.setDescription('Joins voice channel')
)
.addSubcommand(subcommand =>
subcommand
.setName('leave')
.setDescription('Leaves voice channel')
)
.addSubcommand(subcommand =>
subcommand
.setName('url')
.setDescription('Get/set the KoboldAI base url')
.addStringOption(option =>
option.setName('url')
.setDescription('A new KoboldAI base url')
.setRequired(false)
)
)
.addSubcommand(subcommand =>
subcommand
.setName('generate')
.setDescription('Generates AI response for given prompt')
.addStringOption(option =>
option.setName('prompt')
.setDescription('A prompt for the AI')
.setRequired(true)
)
)
]
.map(command => command.toJSON());
const rest = new REST({ version: '10' }).setToken(token);
rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: commands })
.then(() => console.log('Successfully registered application commands.'))
.catch(console.error);