Improve mentions in default log messages. Add !vcmove logging. Don't attempt to !vcmove to the same channel the user is already in.

This commit is contained in:
Dragory 2019-03-16 11:45:30 +02:00
parent cdd977c131
commit e755784483
3 changed files with 48 additions and 32 deletions

View file

@ -685,6 +685,13 @@ export class UtilityPlugin extends ZeppelinPlugin<IBasePluginConfig, IUtilityPlu
return;
}
if (args.member.voiceState.channelID === channel.id) {
msg.channel.createMessage(errorMessage("Member is already on that channel!"));
return;
}
const oldVoiceChannel = this.guild.channels.get(args.member.voiceState.channelID);
try {
await args.member.edit({
channelID: channel.id,
@ -694,6 +701,13 @@ export class UtilityPlugin extends ZeppelinPlugin<IBasePluginConfig, IUtilityPlu
return;
}
this.logs.log(LogType.VOICE_CHANNEL_FORCE_MOVE, {
mod: stripObjectToScalars(msg.author),
member: stripObjectToScalars(args.member, ["user"]),
oldChannel: stripObjectToScalars(oldVoiceChannel),
newChannel: stripObjectToScalars(channel),
});
msg.channel.createMessage(
successMessage(`**${args.member.user.username}#${args.member.user.discriminator}** moved to **${channel.name}**`),
);