This repository has been archived by the owner on May 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
register.js
93 lines (88 loc) · 1.85 KB
/
register.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
const { REST, Routes } = require('discord.js');
require('dotenv').config();
const commands = [
{
name: 'ping',
description: 'Replies with Pong!',
},
{
name: 'github',
description: 'Github!',
},
{
name: 'botinfo',
description: 'Replies with bot info!',
},
{
name: 'login',
description: 'Login with Github',
},
{
name: 'logout',
description: 'Lougout of the service',
},
{
name: 'user',
description: 'Get user info',
},
{
name: "new",
description: "create a new subdomain",
options: [
{
type: 3,
name: "subdomain",
description: "subdomain name",
required: true
},
{
type: 3,
name: "type",
description: "The domain type",
required: true,
choices: [
{
name: "CNAME",
value: "CNAME"
},
{
name: "TXT",
value: "TXT"
},
{
name: "A",
value: "A"
}
]
},
{
type: 3,
name: "content",
description: "domain content",
required: true
}
]
},
{
name: "check",
description: "check if domain is available",
options: [
{
type: 3,
name: "subdomain",
description: "Name of the subdomain",
required: true
}
]
}
];
const rest = new REST({ version: '10' }).setToken(process.env.BOT_TOKEN);
(async () => {
try {
console.log('Started refreshing application (/) commands.');
await rest.put(Routes.applicationCommands(process.env.CLIENT_ID), { body: commands });
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();