diff --git a/ChaosBot/Discord/Services/ExperienceHandler.cs b/ChaosBot/Discord/Services/ExperienceHandler.cs index dd85c52..7412c9a 100644 --- a/ChaosBot/Discord/Services/ExperienceHandler.cs +++ b/ChaosBot/Discord/Services/ExperienceHandler.cs @@ -82,7 +82,7 @@ namespace ChaosBot.Discord.Services } ISocketMessageChannel messageChannel; - if (channelToSendIn != "false") + if (channelToSendIn != null) { ulong channelId = Convert.ToUInt64(channelToSendIn.Substring(2, channelToSendIn.Length - 3)); messageChannel = context.Guild.GetTextChannel(channelId); diff --git a/ChaosBot/Services/ProgrammingLanguageInterpreter/LimitedSocketCommandContext.cs b/ChaosBot/Services/ProgrammingLanguageInterpreter/LimitedSocketCommandContext.cs index f2c06e7..c6f7c5b 100644 --- a/ChaosBot/Services/ProgrammingLanguageInterpreter/LimitedSocketCommandContext.cs +++ b/ChaosBot/Services/ProgrammingLanguageInterpreter/LimitedSocketCommandContext.cs @@ -24,7 +24,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public LimitedSocketUser User { get; } public LimitedSocketCommandContext(SocketCommandContext context) - { + {LoggingFacade.Trace("Reached constructor LimitedSocketCommandContext"); Channel = new LimitedISocketMessageChannel(context.Channel); Client = new LimitedDiscordSocketClient(context.Client); Guild = new LimitedSocketGuild(context.Guild); @@ -40,7 +40,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public DateTimeOffset CreatedAt { get; } public LimitedISocketMessageChannel(ISocketMessageChannel channel) - { + {LoggingFacade.Trace("Reached constructor LimitedISocketMessageChannel"); Name = channel.Name; Id = channel.Id; CreatedAt = channel.CreatedAt; @@ -55,7 +55,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public UserStatus Status { get; } public LimitedDiscordSocketClient(DiscordSocketClient client) - { + {LoggingFacade.Trace("Reached constructor LimitedDiscordSocketClient"); Activity = client.Activity; Latency = client.Latency; ShardId = client.ShardId; @@ -99,7 +99,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public string VoiceRegionId { get; } public LimitedSocketGuild(SocketGuild guild) - { + {LoggingFacade.Trace("Reached constructor LimitedSocketGuild"); Id = guild.Id; AFKChannel = guild.AFKChannel == null ? null : new LimitedSocketVoiceChannel(guild.AFKChannel); AFKTimeout = guild.AFKTimeout; @@ -150,7 +150,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public IReadOnlyCollection MentionedRoles { get; } public IReadOnlyCollection MentionedUsers { get; } public LimitedSocketUserMessage(SocketUserMessage message) - { + {LoggingFacade.Trace("Reached constructor LimitedSocketUserMessage"); Author = new LimitedSocketUser(message.Author); Source = message.Source; Content = message.Content; @@ -184,7 +184,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public string GetAvatarUrl => originalUser.GetAvatarUrl(); public LimitedSocketUser(SocketUser user) - { + {LoggingFacade.Trace("Reached constructor LimitedSocketUser"); originalUser = user; Id = user.Id; @@ -210,13 +210,12 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public ulong Id { get; } public IReadOnlyCollection Users { get; } public LimitedSocketGuildChannel(SocketGuildChannel channel) - { + {LoggingFacade.Trace("Reached constructor LimitedSocketGuildChannel"); Name = channel.Name; Position = channel.Position; PermissionOverwrites = channel.PermissionOverwrites; CreatedAt = channel.CreatedAt; Id = channel.Id; - Users = channel.Users.Select(u => new LimitedSocketGuildUser(u)).ToList(); } } @@ -226,7 +225,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public IReadOnlyCollection Channels { get; } public LimitedSocketCategoryChannel(SocketCategoryChannel category) : base(category) - { + {LoggingFacade.Trace("Reached constructor LimitedSocketCategoryChannel"); Channels = category.Channels.Select(c => new LimitedSocketGuildChannel(c)).ToList(); } } @@ -239,7 +238,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public int? UserLimit { get; } public LimitedSocketVoiceChannel(SocketVoiceChannel channel) : base(channel) - { + {LoggingFacade.Trace("Reached constructor LimitedSocketVoiceChannel"); Bitrate = channel.Bitrate; Category = new LimitedICategoryChannel(channel.Category); CategoryId = channel.CategoryId; @@ -257,7 +256,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public string Topic { get; } public LimitedSocketTextChannel(SocketTextChannel channel) : base(channel) - { + {LoggingFacade.Trace("Reached constructor LimitedSocketTextChannel"); Category = new LimitedICategoryChannel(channel.Category); CategoryId = channel.CategoryId; IsNsfw = channel.IsNsfw; @@ -283,7 +282,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public SocketVoiceState? VoiceState { get; } public LimitedSocketGuildUser(SocketGuildUser user) : base(user) - { + {LoggingFacade.Trace("Reached constructor LimitedSocketGuildUser"); GuildPermissions = user.GuildPermissions; Hierarchy = user.Hierarchy; IsDeafened = user.IsDeafened; @@ -313,7 +312,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public GuildPermissions Permissions { get; } public int Position { get; } public LimitedSocketRole(SocketRole role) - { + {LoggingFacade.Trace("Reached constructor LimitedSocketRole"); Id = role.Id; Color = role.Color; CreatedAt = role.CreatedAt; @@ -340,7 +339,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public IReadOnlyList RoleIds { get; } public LimitedGuildEmote(GuildEmote emote) - { + {LoggingFacade.Trace("Reached constructor LimitedGuildEmote"); Name = emote.Name; Id = emote.Id; Animated = emote.Animated; @@ -362,7 +361,7 @@ namespace ChaosBot.Services.ProgrammingLanguageInterpreter public DateTimeOffset CreatedAt { get; } public ulong Id { get; } public LimitedICategoryChannel(ICategoryChannel category) - { + {LoggingFacade.Trace("Reached constructor LimitedICategoryChannel"); Position = category.Position; GuildId = category.GuildId; PermissionOverwrites = category.PermissionOverwrites;