diff --git a/NadekoBot.Core/Modules/Administration/LogCommands.cs b/NadekoBot.Core/Modules/Administration/LogCommands.cs index 26e311d8..b1fe07df 100644 --- a/NadekoBot.Core/Modules/Administration/LogCommands.cs +++ b/NadekoBot.Core/Modules/Administration/LogCommands.cs @@ -106,11 +106,60 @@ namespace NadekoBot.Modules.Administration [OwnerOnly] public async Task LogEvents() { + _service.GuildLogSettings.TryGetValue(Context.Guild.Id, out LogSetting l); + var str = string.Join("\n", Enum.GetNames(typeof(LogType)) + .Select(x => + { + var val = l == null ? null : GetLogProperty(l, Enum.Parse(x)); + if (val != null) + return $"{Format.Bold(x)} <#{val}>"; + return Format.Bold(x); + })); + await Context.Channel.SendConfirmAsync(Format.Bold(GetText("log_events")) + "\n" + - $"```fix\n{string.Join(", ", Enum.GetNames(typeof(LogType)).Cast())}```") + str) .ConfigureAwait(false); } + private ulong? GetLogProperty(LogSetting l, LogType type) + { + switch (type) + { + case LogType.Other: + return l.LogOtherId; + case LogType.MessageUpdated: + return l.MessageUpdatedId; + case LogType.MessageDeleted: + return l.MessageDeletedId; + case LogType.UserJoined: + return l.UserJoinedId; + case LogType.UserLeft: + return l.UserLeftId; + case LogType.UserBanned: + return l.UserBannedId; + case LogType.UserUnbanned: + return l.UserUnbannedId; + case LogType.UserUpdated: + return l.UserUpdatedId; + case LogType.ChannelCreated: + return l.ChannelCreatedId; + case LogType.ChannelDestroyed: + return l.ChannelDestroyedId; + case LogType.ChannelUpdated: + return l.ChannelUpdatedId; + case LogType.UserPresence: + return l.LogUserPresenceId; + case LogType.VoicePresence: + return l.LogVoicePresenceId; + case LogType.VoicePresenceTTS: + return l.LogVoicePresenceTTSId; + case LogType.UserMuted: + return l.UserMutedId; + default: + return null; + } + } + [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] [RequireUserPermission(GuildPermission.Administrator)]