This repository has been archived by the owner on Sep 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinteraction.js
99 lines (95 loc) · 2.11 KB
/
interaction.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
const fetch = require('node-fetch');
const { token } = require('./config.json');
const { ApplicationCommandOptionType } = require('discord-api-types/v8');
const commands = [
{
name: 'prefix',
description: 'Changes the prefix for the current server',
options: [
{
name: 'prefix',
description: 'The new prefix',
type: ApplicationCommandOptionType.STRING,
required: true
}
]
},
{
name: 'youtubefeeds',
description: 'Sets up automated Youtube feeds in the current channel',
options: [
{
name: 'youtube-channel',
description: 'The YouTube channel',
type: ApplicationCommandOptionType.STRING,
required: true
}
]
},
{
name: 'seteconomy',
description: 'Set the economy channel',
options: [
{
name: 'channel',
description: 'The channel',
type: ApplicationCommandOptionType.CHANNEL,
required: true
}
]
},
{
name: 'setlogs',
description: 'Set the mod log channel',
options: [
{
name: 'channel',
description: 'The channel',
type: ApplicationCommandOptionType.CHANNEL,
required: true
}
]
},
{
name: 'invite',
description: 'Invite the bot'
},
{
name: 'emojiadd',
description: 'Add any emojis to your server!',
options: [
{
name: 'emoji',
description: 'The emoji',
type: ApplicationCommandOptionType.STRING,
required: true
}
]
}
];
// eslint-disable-next-line no-extra-parens
(async () => {
const res = await fetch('https://discord.com/api/v8/applications/663001347372875817/guilds/685219613146873876/commands', {
method: 'PUT',
headers: {
'Authorization': `Bot ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(commands)
});
const body = await res.json();
console.log(res.status, body);
});
// eslint-disable-next-line no-extra-parens
(async () => {
const res = await fetch('https://discord.com/api/v8/applications/658732840783052823/commands', {
method: 'PUT',
headers: {
'Authorization': `Bot ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(commands)
});
const body = await res.json();
console.log(res.status, body);
})();