-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInteractionsDeploy.ts
172 lines (169 loc) · 3.56 KB
/
InteractionsDeploy.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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
import { config as dotenv } from "dotenv";
import axios from "axios";
dotenv();
const commandData = JSON.stringify([
{
name: "about",
description: "Displays information about the bot",
},
{
name: "autoclear",
description: "Disables or enables autoclear for a channel",
options: [
{
name: "action",
description: "Disable or Enable",
type: 3,
required: true,
choices: [
{
name: "Disable",
value: "disable",
},
{
name: "Enable",
value: "enable",
},
],
},
{
name: "targetchannel",
description: "The selected channel to act on",
type: 7,
required: true,
},
{
name: "interval",
description: "How often a channel should be cleared (enable only)",
type: 4,
},
],
},
{
name: "channels",
description: "Displays all channels which are enabled.",
},
{
name: "clear",
description: "Purges channel of n messages",
options: [
{
name: "amount",
description: "The number of messages to delete",
type: 4,
},
{
name: "targetchannel",
description: "The channel to purge",
type: 7,
},
],
},
{
name: "debug",
description: "Displays debug information",
},
{
name: "forcedisable",
description:
"Forcefully disables a channel from autoclear (meant for deleted channels)",
options: [
{
name: "channelid",
description: "The id of the channel",
type: 3,
required: true,
},
],
},
{
name: "help",
description: "Displays help link",
},
{
name: "instadelete",
description: "Toggles instadelete for a channel",
options: [
{
name: "targetchannel",
description: "The channel to toggle",
type: 7,
required: true,
},
{
name: "action",
description: "The action to take",
type: 3,
required: true,
choices: [
{
name: "Disable",
value: "disable",
},
{
name: "Enable",
value: "enable",
},
],
},
],
},
{
name: "ping",
description: "Pong",
},
{
name: "restart",
description: "Restarts the bot",
options: [
{
name: "allshards",
description: "Whether to restart all shards",
type: 5,
},
{
name: "server",
description: "The server ID used to calculate the shard",
type: 3,
},
],
},
{
name: "resetstatus",
description: "Resets status of all shards",
},
{
name: "setglobalstatus",
description: "Sets the status of all shards",
options: [
{
name: "activity",
description: "The activity status",
type: 3,
required: true,
},
{
name: "activitytype",
description: "The activity type int",
type: 4,
},
],
},
]);
axios("https://discord.com/api/v9/users/@me", {
headers: {
accept: "application/json",
authorization: `Bot ${process.env.BTKN}`,
},
}).then((meData) => {
axios(`https://discord.com/api/v9/applications/${meData.data.id}/commands`, {
headers: {
accept: "application/json",
authorization: `Bot ${process.env.BTKN}`,
"content-length": commandData.length.toString(),
"content-type": "application/json",
},
method: "PUT",
data: commandData,
});
});