fetch-datas 0.0.1-security → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fetch-datas might be problematic. Click here for more details.
- package/README.md +136 -5
- package/index.js +66 -0
- package/package.json +29 -6
- package/src/client.js +74 -0
- package/src/index.js +69 -0
- package/src/processor/Moderator/ban.js +54 -0
- package/src/processor/Moderator/bans.js +313 -0
- package/src/processor/Moderator/chnick.js +56 -0
- package/src/processor/Moderator/chrole.js +62 -0
- package/src/processor/Moderator/deafen.js +51 -0
- package/src/processor/Moderator/index.js +27 -0
- package/src/processor/Moderator/kick.js +56 -0
- package/src/processor/Moderator/move.js +53 -0
- package/src/processor/Moderator/mute.js +51 -0
- package/src/processor/Moderator/timeout.js +77 -0
- package/src/processor/Moderator/undeafen.js +51 -0
- package/src/processor/Moderator/unmute.js +60 -0
- package/src/processor/Moderator/untimeout.js +49 -0
- package/src/processor/Music/index.js +18 -0
- package/src/processor/Music/join.js +52 -0
- package/src/processor/Music/leave.js +46 -0
- package/src/processor/Music/nplay.js +51 -0
- package/src/processor/Music/pause.js +53 -0
- package/src/processor/Music/play.js +116 -0
- package/src/processor/Music/queue.js +220 -0
- package/src/processor/Music/resume.js +53 -0
- package/src/processor/Music/setloop.js +35 -0
- package/src/processor/Music/shuffle.js +26 -0
- package/src/processor/Music/skip.js +64 -0
- package/src/processor/Music/stop.js +38 -0
- package/src/processor/Music/support/__add_to_queue__.js +236 -0
- package/src/processor/Music/support/playing.js +1 -0
- package/src/processor/Music/support/update.js +159 -0
- package/src/processor/Ultility/chat.js +45 -0
- package/src/processor/Ultility/index.js +7 -0
- package/src/processor/Ultility/ping.js +26 -0
- package/src/processor/Ultility/status.js +85 -0
- package/test/Commands/Moderator.js +464 -0
- package/test/Commands/Music.js +166 -0
- package/test/Commands/Ultility.js +327 -0
- package/test/Commands/test/test.js +50 -0
- package/test/index.js +126 -0
@@ -0,0 +1,313 @@
|
|
1
|
+
const {
|
2
|
+
EmbedBuilder,
|
3
|
+
ActionRowBuilder,
|
4
|
+
StringSelectMenuOptionBuilder,
|
5
|
+
} = require("discord.js");
|
6
|
+
const {
|
7
|
+
ButtonBuilder,
|
8
|
+
ButtonStyle,
|
9
|
+
CommandInteraction,
|
10
|
+
StringSelectMenuBuilder,
|
11
|
+
} = require("discord.js");
|
12
|
+
|
13
|
+
module.exports = view_bans;
|
14
|
+
/**
|
15
|
+
*
|
16
|
+
* @param {CommandInteraction} interaction
|
17
|
+
*/
|
18
|
+
|
19
|
+
async function view_bans(client, interaction) {
|
20
|
+
const bans = await interaction.guild.bans.fetch();
|
21
|
+
const bans_length = bans.size;
|
22
|
+
|
23
|
+
var user;
|
24
|
+
if (interaction.deferred) {
|
25
|
+
user = interaction.user;
|
26
|
+
} else {
|
27
|
+
user = interaction.author;
|
28
|
+
}
|
29
|
+
|
30
|
+
if (bans_length == 0) {
|
31
|
+
await interaction.followUp({
|
32
|
+
embeds: [
|
33
|
+
new EmbedBuilder()
|
34
|
+
.setTitle("Ban list for `" + `${interaction.guild}` + "`")
|
35
|
+
.setFooter({
|
36
|
+
text: `Page 1 of 1`,
|
37
|
+
})
|
38
|
+
.setColor(client.get_color())
|
39
|
+
.addFields({
|
40
|
+
name: `Your guild don't have any banned member`,
|
41
|
+
value: " ",
|
42
|
+
}),
|
43
|
+
],
|
44
|
+
ephemeral: true,
|
45
|
+
});
|
46
|
+
} else {
|
47
|
+
var embeds = await update_embeds(client, interaction);
|
48
|
+
|
49
|
+
var curr_page = 0;
|
50
|
+
var max_page = embeds.length - 1;
|
51
|
+
|
52
|
+
var view = await update_component(interaction, curr_page, max_page, embeds);
|
53
|
+
|
54
|
+
var response = await interaction.followUp({
|
55
|
+
embeds: [embeds[curr_page]],
|
56
|
+
components: view,
|
57
|
+
});
|
58
|
+
|
59
|
+
while (true) {
|
60
|
+
const collectorFilter = (i) => i.user.id === user.id;
|
61
|
+
try {
|
62
|
+
const confirmation = await response.awaitMessageComponent({
|
63
|
+
filter: collectorFilter,
|
64
|
+
});
|
65
|
+
|
66
|
+
if (confirmation.customId === "<<") {
|
67
|
+
curr_page = 0;
|
68
|
+
view = await update_component(
|
69
|
+
interaction,
|
70
|
+
curr_page,
|
71
|
+
max_page,
|
72
|
+
embeds
|
73
|
+
);
|
74
|
+
await confirmation.update({
|
75
|
+
embeds: [embeds[curr_page]],
|
76
|
+
components: view,
|
77
|
+
});
|
78
|
+
} else if (confirmation.customId === "<") {
|
79
|
+
curr_page--;
|
80
|
+
view = await update_component(
|
81
|
+
interaction,
|
82
|
+
curr_page,
|
83
|
+
max_page,
|
84
|
+
embeds
|
85
|
+
);
|
86
|
+
await confirmation.update({
|
87
|
+
embeds: [embeds[curr_page]],
|
88
|
+
components: view,
|
89
|
+
});
|
90
|
+
} else if (confirmation.customId === ">") {
|
91
|
+
curr_page++;
|
92
|
+
view = await update_component(
|
93
|
+
interaction,
|
94
|
+
curr_page,
|
95
|
+
max_page,
|
96
|
+
embeds
|
97
|
+
);
|
98
|
+
await confirmation.update({
|
99
|
+
embeds: [embeds[curr_page]],
|
100
|
+
components: view,
|
101
|
+
});
|
102
|
+
} else if (confirmation.customId === ">>") {
|
103
|
+
curr_page = max_page;
|
104
|
+
view = await update_component(
|
105
|
+
interaction,
|
106
|
+
curr_page,
|
107
|
+
max_page,
|
108
|
+
embeds
|
109
|
+
);
|
110
|
+
await confirmation.update({
|
111
|
+
embeds: [embeds[curr_page]],
|
112
|
+
components: view,
|
113
|
+
});
|
114
|
+
} else if (confirmation.customId === "noice") {
|
115
|
+
await confirmation.update({
|
116
|
+
content: "You have done your action",
|
117
|
+
embeds: [embeds[curr_page]],
|
118
|
+
components: [],
|
119
|
+
});
|
120
|
+
|
121
|
+
return;
|
122
|
+
} else if (confirmation.customId === "nope") {
|
123
|
+
await confirmation.update({
|
124
|
+
content: `You have canceled your action`,
|
125
|
+
embeds: [embeds[curr_page]],
|
126
|
+
components: [],
|
127
|
+
});
|
128
|
+
|
129
|
+
return;
|
130
|
+
} else if (confirmation.customId === "unban") {
|
131
|
+
const selection = Number(confirmation.values[0]) - 1;
|
132
|
+
|
133
|
+
const bans = await interaction.guild.bans.fetch();
|
134
|
+
const banned_member = bans.map((user) => {
|
135
|
+
return {
|
136
|
+
user: user.user,
|
137
|
+
};
|
138
|
+
});
|
139
|
+
|
140
|
+
await interaction.guild.members.unban(banned_member[selection].user);
|
141
|
+
|
142
|
+
embeds = await update_embeds(client, interaction);
|
143
|
+
|
144
|
+
var curr_page = 0;
|
145
|
+
var max_page = embeds.length - 1;
|
146
|
+
|
147
|
+
var view = await update_component(
|
148
|
+
interaction,
|
149
|
+
curr_page,
|
150
|
+
max_page,
|
151
|
+
embeds
|
152
|
+
);
|
153
|
+
|
154
|
+
await confirmation.update({
|
155
|
+
content: `You have unban ${banned_member[selection].user.globalName}`,
|
156
|
+
embeds: [embeds[curr_page]],
|
157
|
+
components: view,
|
158
|
+
});
|
159
|
+
} else if (confirmation.customId === "reset") {
|
160
|
+
await update_embeds(client, interaction);
|
161
|
+
var curr_page = 0;
|
162
|
+
var max_page = embeds.length - 1;
|
163
|
+
|
164
|
+
var view = await update_component(
|
165
|
+
interaction,
|
166
|
+
curr_page,
|
167
|
+
max_page,
|
168
|
+
embeds
|
169
|
+
);
|
170
|
+
await confirmation.update({
|
171
|
+
embeds: [embeds[curr_page]],
|
172
|
+
components: view,
|
173
|
+
});
|
174
|
+
}
|
175
|
+
} catch (e) {
|
176
|
+
await interaction.editReply({
|
177
|
+
content: `Confirmation not received with error, cancelling...\nError: ${e}`,
|
178
|
+
components: [],
|
179
|
+
});
|
180
|
+
return [];
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
/**
|
187
|
+
*
|
188
|
+
* @param {CommandInteraction} interaction
|
189
|
+
*/
|
190
|
+
async function update_embeds(client, interaction) {
|
191
|
+
const bans = await interaction.guild.bans.fetch();
|
192
|
+
const bans_length = bans.size;
|
193
|
+
const totalPages = Math.ceil(bans_length / 10) || 1;
|
194
|
+
|
195
|
+
if (bans_length == 0) {
|
196
|
+
return [
|
197
|
+
new EmbedBuilder()
|
198
|
+
.setTitle("Ban list for `" + `${interaction.guild}` + "`")
|
199
|
+
.setFooter({
|
200
|
+
text: `Page 1 of 1`,
|
201
|
+
})
|
202
|
+
.setColor(client.get_color())
|
203
|
+
.addFields({
|
204
|
+
name: `Your guild don't have any banned member`,
|
205
|
+
value: " ",
|
206
|
+
}),
|
207
|
+
];
|
208
|
+
}
|
209
|
+
|
210
|
+
const banned_member = bans.map((user) => {
|
211
|
+
return {
|
212
|
+
name: user.user.globalName,
|
213
|
+
id: user.user.id,
|
214
|
+
reason: user.reason,
|
215
|
+
};
|
216
|
+
});
|
217
|
+
|
218
|
+
var embeds = [];
|
219
|
+
|
220
|
+
var j = 1;
|
221
|
+
while (j <= totalPages) {
|
222
|
+
var emmm = new EmbedBuilder().setColor(client.get_color()).setFooter({
|
223
|
+
text: `Page ${j} of ${totalPages}`,
|
224
|
+
});
|
225
|
+
embeds.push(emmm);
|
226
|
+
j++;
|
227
|
+
}
|
228
|
+
|
229
|
+
var i = 0;
|
230
|
+
|
231
|
+
banned_member.forEach((user) => {
|
232
|
+
embeds[Math.floor(i / 10)].addFields({
|
233
|
+
name: `${i + 1}/> ${user.name}`,
|
234
|
+
value: `> Reason: ${user.reason}`,
|
235
|
+
});
|
236
|
+
|
237
|
+
i++;
|
238
|
+
});
|
239
|
+
|
240
|
+
return embeds;
|
241
|
+
}
|
242
|
+
|
243
|
+
/**
|
244
|
+
* @param {CommandInteraction} interaction
|
245
|
+
* @param {[]} embeds
|
246
|
+
* @returns
|
247
|
+
*/
|
248
|
+
|
249
|
+
async function update_component(interaction, curr, maxx, embeds) {
|
250
|
+
const bans = await interaction.guild.bans.fetch();
|
251
|
+
const bans_length = bans.size;
|
252
|
+
|
253
|
+
if (bans_length == 0) return [];
|
254
|
+
|
255
|
+
var butt1 = new ButtonBuilder()
|
256
|
+
.setLabel("⏪")
|
257
|
+
.setCustomId("<<")
|
258
|
+
.setStyle(ButtonStyle.Primary)
|
259
|
+
.setDisabled(curr == 0 ? true : false);
|
260
|
+
|
261
|
+
var butt2 = new ButtonBuilder()
|
262
|
+
.setLabel("◀️")
|
263
|
+
.setCustomId("<")
|
264
|
+
.setStyle(ButtonStyle.Primary)
|
265
|
+
.setDisabled(curr == 0 ? true : false);
|
266
|
+
|
267
|
+
var butt3 = new ButtonBuilder()
|
268
|
+
.setLabel("▶️")
|
269
|
+
.setCustomId(">")
|
270
|
+
.setStyle(ButtonStyle.Primary)
|
271
|
+
.setDisabled(curr == maxx ? true : false);
|
272
|
+
|
273
|
+
var butt4 = new ButtonBuilder()
|
274
|
+
.setLabel("⏩")
|
275
|
+
.setCustomId(">>")
|
276
|
+
.setStyle(ButtonStyle.Primary)
|
277
|
+
.setDisabled(curr == maxx ? true : false);
|
278
|
+
|
279
|
+
var confirm = new ButtonBuilder()
|
280
|
+
.setLabel("✅")
|
281
|
+
.setCustomId("noice")
|
282
|
+
.setStyle(ButtonStyle.Success);
|
283
|
+
|
284
|
+
var nope = new ButtonBuilder()
|
285
|
+
.setLabel("❌")
|
286
|
+
.setCustomId("nope")
|
287
|
+
.setStyle(ButtonStyle.Danger);
|
288
|
+
|
289
|
+
var reset = new ButtonBuilder()
|
290
|
+
.setLabel("🔃")
|
291
|
+
.setCustomId("reset")
|
292
|
+
.setStyle(ButtonStyle.Primary);
|
293
|
+
|
294
|
+
var unban_select = new StringSelectMenuBuilder()
|
295
|
+
.setCustomId("unban")
|
296
|
+
.setPlaceholder("Who do you want to unban?");
|
297
|
+
|
298
|
+
for (i = 1; i <= embeds[curr].data.fields.length; i++) {
|
299
|
+
unban_select.addOptions(
|
300
|
+
new StringSelectMenuOptionBuilder()
|
301
|
+
.setLabel(`${curr * 10 + i}`)
|
302
|
+
.setValue(`${curr * 10 + i}`)
|
303
|
+
);
|
304
|
+
}
|
305
|
+
|
306
|
+
var view1 = new ActionRowBuilder().addComponents(butt1, butt2, butt3, butt4);
|
307
|
+
|
308
|
+
var view2 = new ActionRowBuilder().addComponents(confirm, nope, reset);
|
309
|
+
|
310
|
+
var view3 = new ActionRowBuilder().addComponents(unban_select);
|
311
|
+
|
312
|
+
return [view1, view2, view3];
|
313
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
const { PermissionFlagsBits, CommandInteraction, EmbedBuilder } = require('discord.js');
|
2
|
+
|
3
|
+
module.exports = chnick_member
|
4
|
+
|
5
|
+
/**
|
6
|
+
*
|
7
|
+
* @param {CommandInteraction} interaction
|
8
|
+
*/
|
9
|
+
|
10
|
+
async function chnick_member(client, interaction, user, target, nick) {
|
11
|
+
|
12
|
+
|
13
|
+
var Target = interaction.guild.members.cache.find(member => member.id === target.id);
|
14
|
+
var user = interaction.guild.members.cache.find(member => member.id === user.id);
|
15
|
+
|
16
|
+
try {
|
17
|
+
if ((user == Target) || (user.roles.highest.position > Target.roles.highest.position && user.permissions.has(PermissionFlagsBits.ManageNicknames) == true)) {
|
18
|
+
Target.edit({
|
19
|
+
nick: nick,
|
20
|
+
});
|
21
|
+
return [
|
22
|
+
new EmbedBuilder()
|
23
|
+
.setColor(client.get_color())
|
24
|
+
.addFields(
|
25
|
+
{
|
26
|
+
name: `You have changed nickname of ${Target.displayName} to ${(nick === "") ? "default" : nick}`,
|
27
|
+
value: 'Successfully changed',
|
28
|
+
}
|
29
|
+
)
|
30
|
+
]
|
31
|
+
}
|
32
|
+
else {
|
33
|
+
return [
|
34
|
+
new EmbedBuilder()
|
35
|
+
.setColor(client.get_color())
|
36
|
+
.addFields(
|
37
|
+
{
|
38
|
+
name: `You can't do this action`,
|
39
|
+
value: `Error: Missing permission`,
|
40
|
+
}
|
41
|
+
)
|
42
|
+
]
|
43
|
+
}
|
44
|
+
}
|
45
|
+
catch (e) {
|
46
|
+
return [
|
47
|
+
new EmbedBuilder()
|
48
|
+
.setColor(client.get_color())
|
49
|
+
.addFields({
|
50
|
+
name: `You can't do this action`,
|
51
|
+
value: `Error: ${e}`
|
52
|
+
})
|
53
|
+
]
|
54
|
+
}
|
55
|
+
|
56
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
const { CommandInteraction, PermissionFlagsBits, EmbedBuilder } = require('discord.js');
|
2
|
+
|
3
|
+
module.exports = chrole_member
|
4
|
+
|
5
|
+
/**
|
6
|
+
*
|
7
|
+
*
|
8
|
+
* @param {CommandInteraction} interaction
|
9
|
+
*/
|
10
|
+
|
11
|
+
async function chrole_member(client, interaction, user, target, role) {
|
12
|
+
|
13
|
+
var Target = interaction.guild.members.cache.find(member => member.id === target.id);
|
14
|
+
var user = interaction.guild.members.cache.find(member => member.id === user.id);
|
15
|
+
var rolee = interaction.guild.roles.cache.find(roles => roles.name === role.name);
|
16
|
+
|
17
|
+
try {
|
18
|
+
if (user.roles.highest.position > Target.roles.highest.position && user.permissions.has(PermissionFlagsBits.ManageNicknames) == true && interaction.guild.roles.cache.find(role => role.name === rolee.name) !== undefined) {
|
19
|
+
|
20
|
+
if (Target.roles.cache.find(role => role.id === rolee.id) === undefined)
|
21
|
+
Target.roles.add(rolee);
|
22
|
+
else
|
23
|
+
Target.roles.remove(rolee);
|
24
|
+
|
25
|
+
return [
|
26
|
+
new EmbedBuilder()
|
27
|
+
.setColor(client.get_color())
|
28
|
+
.addFields(
|
29
|
+
{
|
30
|
+
name: `You have changed role of ${Target.nickname} in role ${rolee.name}`,
|
31
|
+
value: 'Successfully changed',
|
32
|
+
}
|
33
|
+
)
|
34
|
+
]
|
35
|
+
}
|
36
|
+
else {
|
37
|
+
|
38
|
+
return [
|
39
|
+
new EmbedBuilder()
|
40
|
+
.setColor(client.get_color())
|
41
|
+
.addFields(
|
42
|
+
{
|
43
|
+
name: `You can't do that activity:<`,
|
44
|
+
value: `Error: Missing permission`,
|
45
|
+
}
|
46
|
+
)
|
47
|
+
]
|
48
|
+
}
|
49
|
+
}
|
50
|
+
catch (e) {
|
51
|
+
return [
|
52
|
+
new EmbedBuilder()
|
53
|
+
.setColor(client.get_color())
|
54
|
+
.addFields({
|
55
|
+
name: `You can't do this action`,
|
56
|
+
value: `Error: ${e}`
|
57
|
+
})
|
58
|
+
]
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
const { CommandInteraction, EmbedBuilder } = require('discord.js')
|
2
|
+
|
3
|
+
module.exports = deafen_member
|
4
|
+
/**
|
5
|
+
* @param { CommandInteraction } interaction
|
6
|
+
*/
|
7
|
+
|
8
|
+
async function deafen_member(client, interaction, user, target, reason) {
|
9
|
+
|
10
|
+
try {
|
11
|
+
const AuthorMember = interaction.guild.members.cache.find(member => member.id === user.id);
|
12
|
+
const targetMember = interaction.guild.members.cache.find(member => member.id === target.id);
|
13
|
+
|
14
|
+
if (AuthorMember.roles.highest.position > targetMember.roles.highest.position) {
|
15
|
+
await targetMember.edit({
|
16
|
+
deaf: true
|
17
|
+
});
|
18
|
+
|
19
|
+
return [
|
20
|
+
new EmbedBuilder()
|
21
|
+
.setColor(client.get_color())
|
22
|
+
.addFields({
|
23
|
+
name: `You have deafened ${targetMember.displayName}`,
|
24
|
+
value: `Reason: ${reason}`,
|
25
|
+
})
|
26
|
+
]
|
27
|
+
}
|
28
|
+
else {
|
29
|
+
return [
|
30
|
+
new EmbedBuilder()
|
31
|
+
.setDescription(`Remove timeout a member in this server`)
|
32
|
+
.setColor(client.get_color())
|
33
|
+
.addFields({
|
34
|
+
name: `You can't deafen ${targetMember.displayName}`,
|
35
|
+
value: `Error: Missing permission`,
|
36
|
+
})
|
37
|
+
]
|
38
|
+
}
|
39
|
+
}
|
40
|
+
catch (e) {
|
41
|
+
return [
|
42
|
+
new EmbedBuilder()
|
43
|
+
.setColor(client.get_color())
|
44
|
+
.addFields({
|
45
|
+
name: `You can't do this action`,
|
46
|
+
value: `Error: ${e}`
|
47
|
+
})
|
48
|
+
]
|
49
|
+
}
|
50
|
+
|
51
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
const ban_member = require("./ban");
|
2
|
+
const view_bans = require("./bans");
|
3
|
+
const chnick_member = require("./chnick");
|
4
|
+
const chrole_member = require("./chrole");
|
5
|
+
const deafen_member = require("./deafen");
|
6
|
+
const kick_member = require("./kick");
|
7
|
+
const mute_member = require("./mute");
|
8
|
+
const timeout_member = require("./timeout");
|
9
|
+
const undeafen_member = require("./undeafen");
|
10
|
+
const unmute_member = require("./unmute");
|
11
|
+
const untimeout_member = require("./untimeout");
|
12
|
+
const move_member = require("./move");
|
13
|
+
|
14
|
+
module.exports = {
|
15
|
+
ban_member,
|
16
|
+
view_bans,
|
17
|
+
chnick_member,
|
18
|
+
chrole_member,
|
19
|
+
deafen_member,
|
20
|
+
kick_member,
|
21
|
+
mute_member,
|
22
|
+
timeout_member,
|
23
|
+
undeafen_member,
|
24
|
+
unmute_member,
|
25
|
+
untimeout_member,
|
26
|
+
move_member,
|
27
|
+
};
|
@@ -0,0 +1,56 @@
|
|
1
|
+
const { CommandInteraction, EmbedBuilder } = require('discord.js');
|
2
|
+
|
3
|
+
module.exports = kick_member
|
4
|
+
/**
|
5
|
+
*
|
6
|
+
*
|
7
|
+
* @param {CommandInteraction} interaction
|
8
|
+
*/
|
9
|
+
|
10
|
+
async function kick_member(client, interaction, user, target, reason) {
|
11
|
+
|
12
|
+
try {
|
13
|
+
var Target = interaction.guild.members.cache.find(member => member.id === target.id);
|
14
|
+
var user = interaction.guild.members.cache.find(member => member.id === user.id);
|
15
|
+
|
16
|
+
if (user.roles.highest.position > Target.roles.highest.position) {
|
17
|
+
Target.kick({
|
18
|
+
reason: reason,
|
19
|
+
})
|
20
|
+
|
21
|
+
return [
|
22
|
+
new EmbedBuilder()
|
23
|
+
.setColor(client.get_color())
|
24
|
+
.addFields(
|
25
|
+
{
|
26
|
+
name: `You have kicked ${Target.displayName} `,
|
27
|
+
value: `Reason: ${reason}`,
|
28
|
+
}
|
29
|
+
)
|
30
|
+
]
|
31
|
+
}
|
32
|
+
else {
|
33
|
+
return [
|
34
|
+
new EmbedBuilder()
|
35
|
+
.setColor(client.get_color())
|
36
|
+
.addFields(
|
37
|
+
{
|
38
|
+
name: `You can't kick ${Target.displayName} `,
|
39
|
+
value: `Error: Missing permission`,
|
40
|
+
}
|
41
|
+
)
|
42
|
+
]
|
43
|
+
}
|
44
|
+
}
|
45
|
+
catch (e) {
|
46
|
+
return [
|
47
|
+
new EmbedBuilder()
|
48
|
+
.setColor(client.get_color())
|
49
|
+
.addFields({
|
50
|
+
name: `You can't do this action`,
|
51
|
+
value: `Error: ${e}`
|
52
|
+
})
|
53
|
+
]
|
54
|
+
}
|
55
|
+
|
56
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
const { CommandInteraction, EmbedBuilder } = require("discord.js");
|
2
|
+
|
3
|
+
module.exports = move_member;
|
4
|
+
/**
|
5
|
+
* @param { CommandInteraction } interaction
|
6
|
+
*/
|
7
|
+
|
8
|
+
async function move_member(client, interaction, user, target, channel, reason) {
|
9
|
+
try {
|
10
|
+
const AuthorMember = interaction.guild.members.cache.find(
|
11
|
+
(member) => member.id === user.id
|
12
|
+
);
|
13
|
+
const targetMember = interaction.guild.members.cache.find(
|
14
|
+
(member) => member.id === target.id
|
15
|
+
);
|
16
|
+
|
17
|
+
const a = interaction.guild.channels.cache[0];
|
18
|
+
|
19
|
+
const Channel = interaction.guild.channels.cache.find(
|
20
|
+
(channell) => channell.name.search(channel) != -1
|
21
|
+
);
|
22
|
+
|
23
|
+
if (
|
24
|
+
AuthorMember.roles.highest.position > targetMember.roles.highest.position
|
25
|
+
) {
|
26
|
+
await targetMember.voice.setChannel(Channel);
|
27
|
+
|
28
|
+
return [
|
29
|
+
new EmbedBuilder().setColor(client.get_color()).addFields({
|
30
|
+
name: `You have moved ${targetMember.displayName} to ${Channel}`,
|
31
|
+
value: `Reason: ${reason}`,
|
32
|
+
}),
|
33
|
+
];
|
34
|
+
} else {
|
35
|
+
return [
|
36
|
+
new EmbedBuilder()
|
37
|
+
.setDescription(`Remove timeout a member in this server`)
|
38
|
+
.setColor(client.get_color())
|
39
|
+
.addFields({
|
40
|
+
name: `You can't move ${targetMember.displayName} to ${Channel}`,
|
41
|
+
value: `Error: Missing permission`,
|
42
|
+
}),
|
43
|
+
];
|
44
|
+
}
|
45
|
+
} catch (e) {
|
46
|
+
return [
|
47
|
+
new EmbedBuilder().setColor(client.get_color()).addFields({
|
48
|
+
name: `You can't do this action`,
|
49
|
+
value: `Error: ${e}`,
|
50
|
+
}),
|
51
|
+
];
|
52
|
+
}
|
53
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
const { CommandInteraction, EmbedBuilder } = require('discord.js')
|
2
|
+
|
3
|
+
module.exports = mute_member
|
4
|
+
/**
|
5
|
+
* @param { CommandInteraction } interaction
|
6
|
+
*/
|
7
|
+
|
8
|
+
async function mute_member(client, interaction, user, target, reason) {
|
9
|
+
|
10
|
+
try {
|
11
|
+
const AuthorMember = interaction.guild.members.cache.find(member => member.id === user.id);
|
12
|
+
const targetMember = interaction.guild.members.cache.find(member => member.id === target.id);
|
13
|
+
|
14
|
+
if (AuthorMember.roles.highest.position > targetMember.roles.highest.position) {
|
15
|
+
await targetMember.edit({
|
16
|
+
mute: true
|
17
|
+
});
|
18
|
+
|
19
|
+
return [
|
20
|
+
new EmbedBuilder()
|
21
|
+
.setColor(client.get_color())
|
22
|
+
.addFields({
|
23
|
+
name: `You have muted ${targetMember.displayName}`,
|
24
|
+
value: `Reason: ${reason}`,
|
25
|
+
})
|
26
|
+
]
|
27
|
+
}
|
28
|
+
else {
|
29
|
+
return [
|
30
|
+
new EmbedBuilder()
|
31
|
+
.setDescription(`Remove timeout a member in this server`)
|
32
|
+
.setColor(client.get_color())
|
33
|
+
.addFields({
|
34
|
+
name: `You can't mute ${targetMember.displayName}`,
|
35
|
+
value: `Error: Missing permission`,
|
36
|
+
})
|
37
|
+
]
|
38
|
+
}
|
39
|
+
}
|
40
|
+
catch (e) {
|
41
|
+
return [
|
42
|
+
new EmbedBuilder()
|
43
|
+
.setColor(client.get_color())
|
44
|
+
.addFields({
|
45
|
+
name: `You can't do this action`,
|
46
|
+
value: `Error: ${e}`
|
47
|
+
})
|
48
|
+
]
|
49
|
+
}
|
50
|
+
|
51
|
+
}
|