forked from LAION-AI/Open-Assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask.ts
25 lines (23 loc) · 801 Bytes
/
task.ts
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
import { SlashCommandBuilder } from "discord.js";
import { getUserLang } from "../modules/open-assistant/user.js";
import { getTranlation } from "../modules/open-assistant/langs.js";
import {
langInteraction,
initInteraction,
} from "../modules/open-assistant/interactions.js";
export default {
data: new SlashCommandBuilder()
.setName("open-assistant")
.setDescription("Help in the data collection of open assistant"),
async execute(interaction, client, commands, commandType) {
var lang = await getUserLang(interaction.user.id);
await interaction.deferReply();
if (!lang) {
await langInteraction(interaction);
} else {
var translation = await getTranlation(lang);
await initInteraction(interaction, translation, lang);
return;
}
},
};