diff --git a/Module/VoiceRoleSync/VoiceRoleSync.cs b/Module/VoiceRoleSync/VoiceRoleSync.cs index 73afec9..b374b6e 100644 --- a/Module/VoiceRoleSync/VoiceRoleSync.cs +++ b/Module/VoiceRoleSync/VoiceRoleSync.cs @@ -26,6 +26,7 @@ namespace Noikoio.RegexBot.Module.VoiceRoleSync // Gather data. if (!(argUser is SocketGuildUser user)) return; // not a guild user var settings = GetState(user.Guild.Id); + if (settings == null) return; // not enabled here var deafened = after.IsDeafened || after.IsSelfDeafened; var (settingBefore, settingAfter) = settings.GetChannelSettings(before.VoiceChannel, after.VoiceChannel); diff --git a/docs/serverdef.md b/docs/serverdef.md index 06a22c6..b01428b 100644 --- a/docs/serverdef.md +++ b/docs/serverdef.md @@ -30,4 +30,5 @@ The following is a list of accepted members within a server definition. * [AutoRespond](autorespond.html) - See respective page. * [EntryAutoRole](entryautorole.html) - See respective page. * [ModCommands](modcommands.html) - See respective page. -* [ModLogs](modlogs.html) - See respective page. \ No newline at end of file +* [ModLogs](modlogs.html) - See respective page. +* [VoiceRoleSync](voicerolesync.html) - See respective page. \ No newline at end of file diff --git a/docs/voicerolesync.md b/docs/voicerolesync.md new file mode 100644 index 0000000..f0f8089 --- /dev/null +++ b/docs/voicerolesync.md @@ -0,0 +1,18 @@ +## VoiceRoleSync + +VoiceRoleSync directs the bot to apply specific roles to users when they are listening in to a voice channel. + +Sample within a [server definition](serverdef.html): +``` +"VoiceRoleSync": { + //"1000001::General": "1000002::In General VC", + //"1000003::Video Games": "1000004::In Gaming VC" + "1000001": "1000002", + "1000003": "1000004" +} +``` + +### Definition structure +A list of voice channels and their respective roles are defined in a `VoiceRoleSync` object. They are defined as JSON properties, with the name portion (before the colon) representing the voice channel and the value portion (after the colon) representing the role to be associated. + +At the moment, only voice channel and role ID values are accepted in this configuration. EntityList-like names will be supported at a later date. \ No newline at end of file