mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
fix(bot-discord): fix getting / command options
This commit is contained in:
@@ -29,15 +29,15 @@ export default {
|
||||
content: 'You don\'t have the required permissions.'
|
||||
});
|
||||
|
||||
interaction.guild.members.ban(interaction.getString('user'), {
|
||||
reason: interaction.getString('reason'),
|
||||
deleteMessageSeconds: interaction.getInteger('dmd') ?
|
||||
interaction.getInteger('dmd') * 86_400 : 0
|
||||
interaction.guild.members.ban(interaction.options.getString('user'), {
|
||||
reason: interaction.options.getString('reason'),
|
||||
deleteMessageSeconds: interaction.options.getString('dmd') ?
|
||||
interaction.options.getString('dmd') * 86_400 : 0
|
||||
});
|
||||
|
||||
reportToLogs(config, interaction.client, 'banned', null, {
|
||||
reason: interaction.getString('reason'),
|
||||
actionTo: await client.users.fetch(interaction.getString('user')),
|
||||
reason: interaction.options.getString('reason'),
|
||||
actionTo: await client.users.fetch(interaction.options.getString('user')),
|
||||
actionBy: interaction.member,
|
||||
channel: interaction.channel
|
||||
});
|
||||
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
|
||||
let member;
|
||||
try {
|
||||
member = await interaction.guild.members.fetch(interaction.getString('user'));
|
||||
member = await interaction.guild.members.fetch(interaction.options.getString('user'));
|
||||
} catch (_) {
|
||||
await interaction.editReply({
|
||||
content: 'Could not find member.'
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
const reason = interaction.getString('reason');
|
||||
const reason = interaction.options.getString('reason');
|
||||
const parsedDuration = await muteMember(config, member, {
|
||||
duration: config.discord.mute.supportMuteDuration,
|
||||
reason,
|
||||
@@ -48,7 +48,7 @@ export default {
|
||||
|
||||
reportToLogs(config, interaction.client, 'muted', null, {
|
||||
reason,
|
||||
actionTo: await client.users.fetch(interaction.getString('user')),
|
||||
actionTo: await client.users.fetch(interaction.options.getString('user')),
|
||||
actionBy: interaction.member,
|
||||
channel: interaction.channel,
|
||||
expire: parsedDuration
|
||||
|
||||
@@ -14,7 +14,7 @@ export default {
|
||||
.setDescription('The member to mute')
|
||||
.setRequired(true)
|
||||
)
|
||||
.addIntegerOption(option =>
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName('duration')
|
||||
.setDescription('The duration of mute')
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
.setRequired(true)
|
||||
),
|
||||
async execute(_, config, interaction) {
|
||||
if (!checkForPerms(config, interaction.member)) return interaction.reply({
|
||||
if (checkForPerms(config, interaction.member)) return interaction.reply({
|
||||
epheremal: true,
|
||||
content: 'You don\'t have the required permissions.'
|
||||
});
|
||||
@@ -36,7 +36,7 @@ export default {
|
||||
|
||||
let member;
|
||||
try {
|
||||
member = await interaction.guild.members.fetch(interaction.getString('user'));
|
||||
member = await interaction.guild.members.fetch(interaction.options.getString('user'));
|
||||
} catch (_) {
|
||||
await interaction.editReply({
|
||||
content: 'Could not find member.'
|
||||
@@ -45,16 +45,16 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
const reason = interaction.getString('reason');
|
||||
const reason = interaction.options.getString('reason');
|
||||
const parsedDuration = await muteMember(config, member, {
|
||||
duration: interaction.getString('duration'),
|
||||
duration: interaction.options.getString('duration'),
|
||||
reason,
|
||||
supportMute: false
|
||||
});
|
||||
|
||||
reportToLogs(config, interaction.client, 'muted', null, {
|
||||
reason,
|
||||
actionTo: await client.users.fetch(interaction.getString('user')),
|
||||
actionTo: await client.users.fetch(interaction.options.getString('user')),
|
||||
actionBy: interaction.member,
|
||||
channel: interaction.channel,
|
||||
expire: parsedDuration
|
||||
|
||||
@@ -19,12 +19,12 @@ export default {
|
||||
content: 'You don\'t have the required permissions.'
|
||||
});
|
||||
|
||||
interaction.guild.members.unban(interaction.getString('user'),
|
||||
interaction.getString('reason'));
|
||||
interaction.guild.members.unban(interaction.options.getString('user'),
|
||||
interaction.options.getString('reason'));
|
||||
|
||||
reportToLogs(config, interaction.client, 'unbanned', null, {
|
||||
reason: interaction.getString('reason'),
|
||||
actionTo: await client.users.fetch(interaction.getString('user')),
|
||||
reason: interaction.options.getString('reason'),
|
||||
actionTo: await client.users.fetch(interaction.options.getString('user')),
|
||||
actionBy: interaction.member,
|
||||
channel: interaction.channel
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ export default {
|
||||
|
||||
let member;
|
||||
try {
|
||||
member = await interaction.guild.members.fetch(interaction.getString('user'));
|
||||
member = await interaction.guild.members.fetch(interaction.options.getString('user'));
|
||||
} catch (_) {
|
||||
await interaction.editReply({
|
||||
content: 'Could not find member.'
|
||||
@@ -33,7 +33,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
const reason = interaction.getString('reason');
|
||||
const reason = interaction.options.getString('reason');
|
||||
const isExiled = await unmuteMember(config, member);
|
||||
|
||||
if (!isExiled) {
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
|
||||
reportToLogs(config, interaction.client, 'unmuted', null, {
|
||||
reason,
|
||||
actionTo: await client.users.fetch(interaction.getString('user')),
|
||||
actionTo: await client.users.fetch(interaction.options.getString('user')),
|
||||
actionBy: interaction.member,
|
||||
channel: interaction.channel,
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ export default {
|
||||
|
||||
let member;
|
||||
try {
|
||||
member = await interaction.guild.members.fetch(interaction.getString('user'));
|
||||
member = await interaction.guild.members.fetch(interaction.options.getString('user'));
|
||||
} catch (_) {
|
||||
await interaction.editReply({
|
||||
content: 'Could not find member.'
|
||||
@@ -33,7 +33,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
const reason = interaction.getString('reason');
|
||||
const reason = interaction.options.getString('reason');
|
||||
const isMuted = await unmuteMember(config, member);
|
||||
|
||||
if (!isMuted) {
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
|
||||
reportToLogs(config, interaction.client, 'unmuted', null, {
|
||||
reason,
|
||||
actionTo: await client.users.fetch(interaction.getString('user')),
|
||||
actionTo: await client.users.fetch(interaction.options.getString('user')),
|
||||
actionBy: interaction.member,
|
||||
channel: interaction.channel,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user