don't let the bot starts if any of the readys fails

This commit is contained in:
Toastie 2025-02-04 00:53:00 +13:00
parent 3f26f9f8f5
commit 6ef732a1f0
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7
6 changed files with 9 additions and 7 deletions

View file

@ -309,6 +309,8 @@ public sealed class Bot : IBot
"Failed running OnReadyAsync method on {Type} type: {Message}",
toExec.GetType().Name,
ex.Message);
Environment.Exit(9);
}
});

View file

@ -8,7 +8,7 @@ public class FilterChannelId
[Key]
public int Id { get; set; }
public int GuildFilterConfigId { get; set; }
public int? GuildFilterConfigId { get; set; }
public ulong ChannelId { get; set; }

View file

@ -3,7 +3,7 @@ namespace EllieBot.Db.Models;
public class FilterLinksChannelId : DbEntity
{
public ulong ChannelId { get; set; }
public int GuildFilterConfigId { get; set; }
public int? GuildFilterConfigId { get; set; }
protected bool Equals(FilterLinksChannelId other)
=> ChannelId == other.ChannelId;

View file

@ -3,7 +3,7 @@ namespace EllieBot.Db.Models;
public class FilterWordsChannelId : DbEntity
{
public int GuildFilterConfigId { get; set; }
public int? GuildFilterConfigId { get; set; }
public ulong ChannelId { get; set; }
protected bool Equals(FilterWordsChannelId other)

View file

@ -2,10 +2,10 @@ namespace EllieBot.Db.Models;
public class FilteredWord : DbEntity
{
public int GuildFilterConfigId { get; set; }
public string Word { get; set; } = string.Empty;
public int? GuildFilterConfigId { get; set; }
public string? Word { get; set; }
public override bool Equals(object? obj) => obj is FilteredWord fw && fw.Word == Word;
public override int GetHashCode() => Word.GetHashCode();
}

View file

@ -2,7 +2,7 @@
public class ExcludedItem : DbEntity
{
public int XpSettingsId { get; set; }
public int? XpSettingsId { get; set; }
public ulong ItemId { get; set; }
public ExcludedItemType ItemType { get; set; }