- NadekoBot class renamed to Bot

- Implemented grpc based coordinator. Supports restarting, killing single or all shards, as well as getting current shard statuses. (Adaptation of the one used by the public bot)
- Coord is setup via coord.yml file
- Methods from SelfService which deal with shard/bot restart etc have been moved to ICoordinator (with GrpcRemoteCoordinator being the default implementation atm)
- Vastly simplified NadekoBot/Program.cs
This commit is contained in:
Kwoth
2021-06-19 13:13:54 +02:00
parent d8c7cdc7f4
commit c86bf6f300
58 changed files with 1212 additions and 635 deletions

View File

@@ -325,7 +325,7 @@ namespace NadekoBot.Modules.Searches
}
await ctx.Channel.EmbedAsync(new EmbedBuilder()
.WithColor(NadekoBot.OkColor)
.WithColor(Bot.OkColor)
.AddField(efb => efb.WithName(GetText("original_url"))
.WithValue($"<{query}>"))
.AddField(efb => efb.WithName(GetText("short_url"))

View File

@@ -24,7 +24,7 @@ namespace NadekoBot.Modules.Searches.Services
private readonly ConcurrentDictionary<string, DateTime> _lastPosts =
new ConcurrentDictionary<string, DateTime>();
public FeedsService(NadekoBot bot, DbService db, DiscordSocketClient client)
public FeedsService(Bot bot, DbService db, DiscordSocketClient client)
{
_db = db;

View File

@@ -61,7 +61,7 @@ namespace NadekoBot.Modules.Searches.Services
private readonly List<string> _yomamaJokes;
public SearchesService(DiscordSocketClient client, IGoogleApiService google,
DbService db, NadekoBot bot, IDataCache cache, IHttpClientFactory factory,
DbService db, Bot bot, IDataCache cache, IHttpClientFactory factory,
FontProvider fonts, IBotCredentials creds)
{
_httpFactory = factory;

View File

@@ -46,7 +46,7 @@ namespace NadekoBot.Modules.Searches.Services
public StreamNotificationService(DbService db, DiscordSocketClient client,
IBotStrings strings, IDataCache cache, IBotCredentials creds, IHttpClientFactory httpFactory,
NadekoBot bot)
Bot bot)
{
_db = db;
_client = client;
@@ -457,7 +457,7 @@ namespace NadekoBot.Modules.Searches.Services
.AddField(efb => efb.WithName(GetText(guildId, "viewers"))
.WithValue(status.IsLive ? status.Viewers.ToString() : "-")
.WithIsInline(true))
.WithColor(status.IsLive ? NadekoBot.OkColor : NadekoBot.ErrorColor);
.WithColor(status.IsLive ? Bot.OkColor : Bot.ErrorColor);
if (!string.IsNullOrWhiteSpace(status.Title))
embed.WithAuthor(status.Title);

View File

@@ -34,7 +34,7 @@ namespace NadekoBot.Modules.Searches
{
var res = await http.GetStringAsync($"{_xkcdUrl}/info.0.json").ConfigureAwait(false);
var comic = JsonConvert.DeserializeObject<XkcdComic>(res);
var embed = new EmbedBuilder().WithColor(NadekoBot.OkColor)
var embed = new EmbedBuilder().WithColor(Bot.OkColor)
.WithImageUrl(comic.ImageLink)
.WithAuthor(eab => eab.WithName(comic.Title).WithUrl($"{_xkcdUrl}/{comic.Num}").WithIconUrl("https://xkcd.com/s/919f27.ico"))
.AddField(efb => efb.WithName(GetText("comic_number")).WithValue(comic.Num.ToString()).WithIsInline(true))
@@ -69,7 +69,7 @@ namespace NadekoBot.Modules.Searches
var res = await http.GetStringAsync($"{_xkcdUrl}/{num}/info.0.json").ConfigureAwait(false);
var comic = JsonConvert.DeserializeObject<XkcdComic>(res);
var embed = new EmbedBuilder().WithColor(NadekoBot.OkColor)
var embed = new EmbedBuilder().WithColor(Bot.OkColor)
.WithImageUrl(comic.ImageLink)
.WithAuthor(eab => eab.WithName(comic.Title).WithUrl($"{_xkcdUrl}/{num}").WithIconUrl("https://xkcd.com/s/919f27.ico"))
.AddField(efb => efb.WithName(GetText("comic_number")).WithValue(comic.Num.ToString()).WithIsInline(true))