Finish preliminary rework, ready to test

This commit is contained in:
Dark 2021-06-02 04:07:50 +02:00
parent 57893e7f76
commit d0a1beb809
No known key found for this signature in database
GPG key ID: 2CD6ACB6B0A87B8A
177 changed files with 854 additions and 707 deletions

View file

@ -54,9 +54,7 @@ export const FollowCmd = locateUserCmd({
sendSuccessMessage(
pluginData,
msg.channel,
`Every time <@${args.member.id}> joins or switches VC in the next ${humanizeDuration(
time,
)} i will notify you`,
`Every time <@${args.member.id}> joins or switches VC in the next ${humanizeDuration(time)} i will notify you`,
);
}
},

View file

@ -6,7 +6,7 @@ export const VoiceStateUpdateAlertEvt = locateUserEvt({
event: "voiceStateUpdate",
async listener(meta) {
const memberId = meta.args.oldState.member ? meta.args.oldState.member.id : meta.args.newState.member!.id;
const memberId = meta.args.oldState.member ? meta.args.oldState.member.id : meta.args.newState.member!.id;
if (meta.args.newState.channel != null) {
if (meta.pluginData.state.usersWithAlerts.includes(memberId)) {
@ -20,8 +20,8 @@ export const VoiceStateUpdateAlertEvt = locateUserEvt({
const txtChannel = meta.pluginData.guild.channels.resolve(alert.channel_id) as TextChannel;
txtChannel.send(
`🔴 <@!${alert.requestor_id}> the user <@!${alert.user_id}> disconnected out of \`<#!${voiceChannel.id}>\``,
);
});
);
});
}
},
});

View file

@ -13,7 +13,7 @@ export async function moveMember(
if (modMember.voice.channelID != null) {
try {
await modMember.edit({
channel: target.voice.channelID
channel: target.voice.channelID,
});
} catch {
sendErrorMessage(pluginData, errorChannel, "Failed to move you. Are you in a voice channel?");