fixed .log command not showing
This commit is contained in:
parent
f155619793
commit
5e267435d4
@ -124,49 +124,49 @@ namespace NadekoBot.Modules.Administration
|
|||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case LogType.Other:
|
case LogType.Other:
|
||||||
channelId = logSetting.LogOtherId = (logSetting.LogOtherId == null ? channel.Id : default);
|
channelId = logSetting.LogOtherId = (logSetting.LogOtherId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.MessageUpdated:
|
case LogType.MessageUpdated:
|
||||||
channelId = logSetting.MessageUpdatedId = (logSetting.MessageUpdatedId == null ? channel.Id : default);
|
channelId = logSetting.MessageUpdatedId = (logSetting.MessageUpdatedId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.MessageDeleted:
|
case LogType.MessageDeleted:
|
||||||
channelId = logSetting.MessageDeletedId = (logSetting.MessageDeletedId == null ? channel.Id : default);
|
channelId = logSetting.MessageDeletedId = (logSetting.MessageDeletedId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.UserJoined:
|
case LogType.UserJoined:
|
||||||
channelId = logSetting.UserJoinedId = (logSetting.UserJoinedId == null ? channel.Id : default);
|
channelId = logSetting.UserJoinedId = (logSetting.UserJoinedId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.UserLeft:
|
case LogType.UserLeft:
|
||||||
channelId = logSetting.UserLeftId = (logSetting.UserLeftId == null ? channel.Id : default);
|
channelId = logSetting.UserLeftId = (logSetting.UserLeftId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.UserBanned:
|
case LogType.UserBanned:
|
||||||
channelId = logSetting.UserBannedId = (logSetting.UserBannedId == null ? channel.Id : default);
|
channelId = logSetting.UserBannedId = (logSetting.UserBannedId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.UserUnbanned:
|
case LogType.UserUnbanned:
|
||||||
channelId = logSetting.UserUnbannedId = (logSetting.UserUnbannedId == null ? channel.Id : default);
|
channelId = logSetting.UserUnbannedId = (logSetting.UserUnbannedId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.UserUpdated:
|
case LogType.UserUpdated:
|
||||||
channelId = logSetting.UserUpdatedId = (logSetting.UserUpdatedId == null ? channel.Id : default);
|
channelId = logSetting.UserUpdatedId = (logSetting.UserUpdatedId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.UserMuted:
|
case LogType.UserMuted:
|
||||||
channelId = logSetting.UserMutedId = (logSetting.UserMutedId == null ? channel.Id : default);
|
channelId = logSetting.UserMutedId = (logSetting.UserMutedId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.ChannelCreated:
|
case LogType.ChannelCreated:
|
||||||
channelId = logSetting.ChannelCreatedId = (logSetting.ChannelCreatedId == null ? channel.Id : default);
|
channelId = logSetting.ChannelCreatedId = (logSetting.ChannelCreatedId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.ChannelDestroyed:
|
case LogType.ChannelDestroyed:
|
||||||
channelId = logSetting.ChannelDestroyedId = (logSetting.ChannelDestroyedId == null ? channel.Id : default);
|
channelId = logSetting.ChannelDestroyedId = (logSetting.ChannelDestroyedId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.ChannelUpdated:
|
case LogType.ChannelUpdated:
|
||||||
channelId = logSetting.ChannelUpdatedId = (logSetting.ChannelUpdatedId == null ? channel.Id : default);
|
channelId = logSetting.ChannelUpdatedId = (logSetting.ChannelUpdatedId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.UserPresence:
|
case LogType.UserPresence:
|
||||||
channelId = logSetting.LogUserPresenceId = (logSetting.LogUserPresenceId == null ? channel.Id : default);
|
channelId = logSetting.LogUserPresenceId = (logSetting.LogUserPresenceId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.VoicePresence:
|
case LogType.VoicePresence:
|
||||||
channelId = logSetting.LogVoicePresenceId = (logSetting.LogVoicePresenceId == null ? channel.Id : default);
|
channelId = logSetting.LogVoicePresenceId = (logSetting.LogVoicePresenceId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
case LogType.VoicePresenceTTS:
|
case LogType.VoicePresenceTTS:
|
||||||
channelId = logSetting.LogVoicePresenceTTSId = (logSetting.LogVoicePresenceTTSId == null ? channel.Id : default);
|
channelId = logSetting.LogVoicePresenceTTSId = (logSetting.LogVoicePresenceTTSId == null ? (ulong?)channel.Id : default);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -950,7 +950,7 @@ namespace NadekoBot.Modules.Administration.Services
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!id.HasValue)
|
if (!id.HasValue || id == 0)
|
||||||
{
|
{
|
||||||
UnsetLogSetting(guild.Id, logChannelType);
|
UnsetLogSetting(guild.Id, logChannelType);
|
||||||
return null;
|
return null;
|
||||||
|
@ -8,5 +8,7 @@ namespace NadekoBot.Modules.Gambling.Services
|
|||||||
{
|
{
|
||||||
public ConcurrentDictionary<ulong, DateTime> DivorceCooldowns { get; } = new ConcurrentDictionary<ulong, DateTime>();
|
public ConcurrentDictionary<ulong, DateTime> DivorceCooldowns { get; } = new ConcurrentDictionary<ulong, DateTime>();
|
||||||
public ConcurrentDictionary<ulong, DateTime> AffinityCooldowns { get; } = new ConcurrentDictionary<ulong, DateTime>();
|
public ConcurrentDictionary<ulong, DateTime> AffinityCooldowns { get; } = new ConcurrentDictionary<ulong, DateTime>();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,17 +16,25 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
public partial class Permissions
|
public partial class Permissions
|
||||||
{
|
{
|
||||||
[Group]
|
[Group]
|
||||||
public class FilterCommands : NadekoSubmodule
|
public class FilterCommands : NadekoSubmodule<FilterService>
|
||||||
{
|
{
|
||||||
private readonly DbService _db;
|
private readonly DbService _db;
|
||||||
private readonly FilterService _service;
|
|
||||||
|
|
||||||
public FilterCommands(FilterService service, DbService db)
|
public FilterCommands(DbService db)
|
||||||
{
|
{
|
||||||
_service = service;
|
|
||||||
_db = db;
|
_db = db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//[NadekoCommand, Usage, Description, Aliases]
|
||||||
|
//[RequireContext(ContextType.Guild)]
|
||||||
|
//public async Task SrvrFilterLinks()
|
||||||
|
//{
|
||||||
|
// using (var uow = _db.UnitOfWork)
|
||||||
|
// {
|
||||||
|
// var config =
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
[NadekoCommand, Usage, Description, Aliases]
|
[NadekoCommand, Usage, Description, Aliases]
|
||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task SrvrFilterInv()
|
public async Task SrvrFilterInv()
|
||||||
|
@ -27,6 +27,9 @@ namespace NadekoBot.Modules.Permissions.Services
|
|||||||
public ConcurrentHashSet<ulong> WordFilteringChannels { get; }
|
public ConcurrentHashSet<ulong> WordFilteringChannels { get; }
|
||||||
public ConcurrentHashSet<ulong> WordFilteringServers { get; }
|
public ConcurrentHashSet<ulong> WordFilteringServers { get; }
|
||||||
|
|
||||||
|
//public ConcurrentHashSet<ulong> LinkFilteringServers { get; }
|
||||||
|
//public ConcurrentDictionary<ulong, bool> LinkFilteringChannelSettings { get; }
|
||||||
|
|
||||||
public ConcurrentHashSet<string> FilteredWordsForChannel(ulong channelId, ulong guildId)
|
public ConcurrentHashSet<string> FilteredWordsForChannel(ulong channelId, ulong guildId)
|
||||||
{
|
{
|
||||||
ConcurrentHashSet<string> words = new ConcurrentHashSet<string>();
|
ConcurrentHashSet<string> words = new ConcurrentHashSet<string>();
|
||||||
@ -56,9 +59,10 @@ namespace NadekoBot.Modules.Permissions.Services
|
|||||||
|
|
||||||
var serverFiltering = bot.AllGuildConfigs.Where(gc => gc.FilterWords);
|
var serverFiltering = bot.AllGuildConfigs.Where(gc => gc.FilterWords);
|
||||||
WordFilteringServers = new ConcurrentHashSet<ulong>(serverFiltering.Select(gc => gc.GuildId));
|
WordFilteringServers = new ConcurrentHashSet<ulong>(serverFiltering.Select(gc => gc.GuildId));
|
||||||
|
|
||||||
WordFilteringChannels = new ConcurrentHashSet<ulong>(bot.AllGuildConfigs.SelectMany(gc => gc.FilterWordsChannelIds.Select(fwci => fwci.ChannelId)));
|
WordFilteringChannels = new ConcurrentHashSet<ulong>(bot.AllGuildConfigs.SelectMany(gc => gc.FilterWordsChannelIds.Select(fwci => fwci.ChannelId)));
|
||||||
|
|
||||||
|
//LinkFilteringServers = new ConcurrentHashSet<ulong>(bot.AllGuildConfigs.Where(gc => gc.FilterLinks).Select(x => x.GuildId));
|
||||||
|
|
||||||
_client.MessageUpdated += (oldData, newMsg, channel) =>
|
_client.MessageUpdated += (oldData, newMsg, channel) =>
|
||||||
{
|
{
|
||||||
var _ = Task.Run(() =>
|
var _ = Task.Run(() =>
|
||||||
|
@ -55,6 +55,9 @@ namespace NadekoBot.Core.Services.Database.Models
|
|||||||
public bool FilterInvites { get; set; }
|
public bool FilterInvites { get; set; }
|
||||||
public HashSet<FilterChannelId> FilterInvitesChannelIds { get; set; } = new HashSet<FilterChannelId>();
|
public HashSet<FilterChannelId> FilterInvitesChannelIds { get; set; } = new HashSet<FilterChannelId>();
|
||||||
|
|
||||||
|
public bool FilterLinks { get; set; }
|
||||||
|
public HashSet<FilterLinksChannelId> FilterLinksChannels { get; set; } = new HashSet<FilterLinksChannelId>();
|
||||||
|
|
||||||
public bool FilterWords { get; set; }
|
public bool FilterWords { get; set; }
|
||||||
public HashSet<FilteredWord> FilteredWords { get; set; } = new HashSet<FilteredWord>();
|
public HashSet<FilteredWord> FilteredWords { get; set; } = new HashSet<FilteredWord>();
|
||||||
public HashSet<FilterChannelId> FilterWordsChannelIds { get; set; } = new HashSet<FilterChannelId>();
|
public HashSet<FilterChannelId> FilterWordsChannelIds { get; set; } = new HashSet<FilterChannelId>();
|
||||||
@ -211,6 +214,23 @@ namespace NadekoBot.Core.Services.Database.Models
|
|||||||
public ulong ChannelId { get; set; }
|
public ulong ChannelId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class FilterLinksChannelId : DbEntity
|
||||||
|
{
|
||||||
|
public ulong ChannelId { get; set; }
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
return obj is FilterLinksChannelId f
|
||||||
|
? f.ChannelId == ChannelId
|
||||||
|
: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return ChannelId.GetHashCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class FilteredWord : DbEntity
|
public class FilteredWord : DbEntity
|
||||||
{
|
{
|
||||||
public string Word { get; set; }
|
public string Word { get; set; }
|
||||||
|
Loading…
Reference in New Issue
Block a user