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 System.Globalization;
#nullable disable
using System.Globalization;
namespace NadekoBot.Services;
@@ -12,4 +13,4 @@ public interface IBotStrings
void Reload();
CommandStrings GetCommandStrings(string commandName, ulong? guildId = null);
CommandStrings GetCommandStrings(string commandName, CultureInfo cultureInfo);
}
}

View File

@@ -1,4 +1,5 @@
namespace NadekoBot.Services;
#nullable disable
namespace NadekoBot.Services;
/// <summary>
/// Implemented by classes which provide localized strings in their own ways
@@ -24,4 +25,4 @@ public interface IBotStringsProvider
/// <param name="localeName">Language name</param>
/// <param name="commandName">Command name</param>
CommandStrings GetCommandStrings(string localeName, string commandName);
}
}

View File

@@ -1,4 +1,5 @@
namespace NadekoBot.Services;
#nullable disable
namespace NadekoBot.Services;
/// <summary>
/// Basic interface used for classes implementing strings loading mechanism
@@ -12,4 +13,4 @@ public interface IStringsSource
Dictionary<string, Dictionary<string, string>> GetResponseStrings();
Dictionary<string, Dictionary<string, CommandStrings>> GetCommandStrings();
}
}

View File

@@ -1,4 +1,5 @@
using System.Globalization;
#nullable disable
using System.Globalization;
using YamlDotNet.Serialization;
namespace NadekoBot.Services;
@@ -99,4 +100,4 @@ public class CommandStrings
public string Desc { get; set; }
[YamlMember(Alias = "args")]
public string[] Args { get; set; }
}
}

View File

@@ -1,4 +1,5 @@
namespace NadekoBot.Services;
#nullable disable
namespace NadekoBot.Services;
public class LocalBotStringsProvider : IBotStringsProvider
{
@@ -39,4 +40,4 @@ public class LocalBotStringsProvider : IBotStringsProvider
return null;
}
}
}

View File

@@ -1,4 +1,5 @@
using Newtonsoft.Json;
#nullable disable
using Newtonsoft.Json;
using YamlDotNet.Serialization;
namespace NadekoBot.Services;
@@ -69,4 +70,4 @@ public class LocalFileStringsSource : IStringsSource
var secondDotIndex = fileName.LastIndexOf('.');
return fileName.Substring(dotIndex, secondDotIndex - dotIndex);
}
}
}

View File

@@ -1,4 +1,5 @@
using System.Web;
#nullable disable
using System.Web;
using StackExchange.Redis;
namespace NadekoBot.Services;
@@ -72,4 +73,4 @@ public class RedisBotStringsProvider : IBotStringsProvider
redisDb.HashSet($"{_creds.RedisKey()}:commands:{localeName}", hashFields);
}
}
}
}