NadekoBot.Extensions should now be fully annotated with nullable reference types as well as many classes from NadekoBot.Common

This commit is contained in:
Kwoth
2021-12-28 10:44:00 +01:00
parent 0634470a8a
commit 59f5056035
543 changed files with 1895 additions and 1448 deletions

View File

@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
#nullable disable
using Microsoft.EntityFrameworkCore;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db;
@@ -152,4 +153,4 @@ public class AdministrationService : INService
await umsg.EditAsync(text);
}
}
}

View File

@@ -1,4 +1,5 @@
using System.Threading.Channels;
#nullable disable
using System.Threading.Channels;
using LinqToDB;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Services.Database.Models;
@@ -156,4 +157,4 @@ public static class GuildConfigExtensions
public static void SetAutoAssignableRoles(this GuildConfig gc, IEnumerable<ulong> roles)
=> gc.AutoAssignRoleIds = roles.Join(',');
}
}

View File

@@ -1,3 +1,4 @@
#nullable disable
using Microsoft.EntityFrameworkCore;
using LinqToDB;
using LinqToDB.EntityFrameworkCore;
@@ -128,4 +129,4 @@ DELETE FROM Clubs;";
await uow.DiscordUser
.DeleteAsync(u => u.UserId == userId);
}
}
}

View File

@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
#nullable disable
using Microsoft.EntityFrameworkCore;
using NadekoBot.Common.ModuleBehaviors;
using NadekoBot.Services.Database.Models;
@@ -131,4 +132,4 @@ public class DiscordPermOverrideService : INService, ILateBlocker
return false;
}
}
}

View File

@@ -1,4 +1,5 @@
using NadekoBot.Db;
#nullable disable
using NadekoBot.Db;
namespace NadekoBot.Modules.Administration.Services;
@@ -120,4 +121,4 @@ public class GameVoiceChannelService : INService
await Task.Delay(1000).ConfigureAwait(false);
await gUser.ModifyAsync(gu => gu.Channel = vch).ConfigureAwait(false);
}
}
}

View File

@@ -1,4 +1,5 @@
using NadekoBot.Services.Database.Models;
#nullable disable
using NadekoBot.Services.Database.Models;
using NadekoBot.Db;
namespace NadekoBot.Modules.Administration.Services;
@@ -73,4 +74,4 @@ public class GuildTimezoneService : INService
public TimeZoneInfo GetTimeZoneOrUtc(ulong guildId)
=> GetTimeZoneOrDefault(guildId) ?? TimeZoneInfo.Utc;
}
}

View File

@@ -1,4 +1,5 @@
using System.Net;
#nullable disable
using System.Net;
using System.Threading.Channels;
using LinqToDB;
using Microsoft.Extensions.Caching.Memory;
@@ -172,4 +173,4 @@ public sealed class ImageOnlyChannelService : IEarlyBehavior
}
public int Priority { get; } = 0;
}
}

View File

@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
#nullable disable
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db;
@@ -1232,4 +1233,4 @@ public sealed class LogCommandService : ILogCommandService
GuildLogSettings.AddOrUpdate(guildId, newLogSetting, (gid, old) => newLogSetting);
uow.SaveChanges();
}
}
}

View File

@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
#nullable disable
using Microsoft.EntityFrameworkCore;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db;
@@ -460,4 +461,4 @@ public class MuteService : INService
}
uow.SaveChanges();
}
}
}

View File

@@ -1,4 +1,5 @@
using NadekoBot.Services.Database.Models;
#nullable disable
using NadekoBot.Services.Database.Models;
using Microsoft.EntityFrameworkCore;
namespace NadekoBot.Modules.Administration.Services;
@@ -109,4 +110,4 @@ public sealed class PlayingRotateService : INService
using var uow = _db.GetDbContext();
return uow.RotatingStatus.AsNoTracking().ToList();
}
}
}

View File

@@ -1,4 +1,5 @@
using System.Threading.Channels;
#nullable disable
using System.Threading.Channels;
using NadekoBot.Modules.Administration.Common;
using NadekoBot.Services.Database.Models;
using Microsoft.EntityFrameworkCore;
@@ -465,4 +466,4 @@ public class ProtectionService : INService
await uow.SaveChangesAsync();
return true;
}
}
}

View File

@@ -1,4 +1,5 @@
namespace NadekoBot.Modules.Administration.Services;
#nullable disable
namespace NadekoBot.Modules.Administration.Services;
public class PruneService : INService
{
@@ -63,4 +64,4 @@ public class PruneService : INService
_pruningGuilds.TryRemove(channel.GuildId);
}
}
}
}

View File

@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
#nullable disable
using Microsoft.EntityFrameworkCore;
using NadekoBot.Common.Collections;
using NadekoBot.Services.Database.Models;
using LinqToDB;
@@ -239,4 +240,4 @@ public class RoleCommandsService : INService
await Task.Delay(100, cToken).ConfigureAwait(false);
}
}
}
}

View File

@@ -1,4 +1,5 @@
using NadekoBot.Services.Database.Models;
#nullable disable
using NadekoBot.Services.Database.Models;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Db;
using NadekoBot.Modules.Xp;
@@ -245,4 +246,4 @@ public class SelfAssignedRolesService : INService
return (exclusive, roles.Where(x => x.Role != null), groupNames);
}
}
}

View File

@@ -1,4 +1,5 @@
using System.Collections.Immutable;
#nullable disable
using System.Collections.Immutable;
using NadekoBot.Common.ModuleBehaviors;
using Microsoft.EntityFrameworkCore;
using NadekoBot.Services.Database.Models;
@@ -388,4 +389,4 @@ public sealed class SelfService : ILateExecutor, IReadyExecutor, INService
public string Link { get; init; }
public ActivityType Type { get; init; }
}
}
}

View File

@@ -1,3 +1,4 @@
#nullable disable
using Microsoft.EntityFrameworkCore;
using NadekoBot.Common.TypeReaders.Models;
using NadekoBot.Services.Database.Models;
@@ -488,4 +489,4 @@ WHERE GuildId={guildId}
var output = SmartText.CreateFrom(template);
return replacer.Replace(output);
}
}
}

View File

@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
#nullable disable
using Microsoft.EntityFrameworkCore;
using NadekoBot.Services.Database.Models;
using NadekoBot.Db;
@@ -210,4 +211,4 @@ public class VcRoleService : INService
var queue = ToAssign.GetOrAdd(gusr.Guild.Id, new ConcurrentQueue<(bool, IGuildUser, IRole)>());
queue.Enqueue((v, gusr, role));
}
}
}