Medusa System Added

Read about the medusa system [here](https://nadekobot.readthedocs.io/en/latest/medusa/creating-a-medusa/)
This commit is contained in:
Kwoth
2022-04-16 12:44:46 +00:00
parent 3a516ab32a
commit 7cb15f5278
103 changed files with 3363 additions and 203 deletions

View File

@@ -93,7 +93,7 @@ public class GameStatusEvent : ICurrencyEvent
});
}
Log.Information("Awarded {Count} users {Amount} currency.{Remaining}",
Log.Information("Game status event awarded {Count} users {Amount} currency.{Remaining}",
toAward.Count,
_amount,
_isPotLimited ? $" {PotSize} left." : "");

View File

@@ -86,7 +86,7 @@ public class ReactionEvent : ICurrencyEvent
});
}
Log.Information("Awarded {Count} users {Amount} currency.{Remaining}",
Log.Information("Reaction Event awarded {Count} users {Amount} currency.{Remaining}",
toAward.Count,
_amount,
_isPotLimited ? $" {PotSize} left." : "");

View File

@@ -1,5 +1,6 @@
#nullable disable
using Microsoft.EntityFrameworkCore;
using NadekoBot.Common.ModuleBehaviors;
using NadekoBot.Db;
using NadekoBot.Services.Database.Models;
using SixLabors.Fonts;
@@ -12,7 +13,7 @@ using Image = SixLabors.ImageSharp.Image;
namespace NadekoBot.Modules.Gambling.Services;
public class PlantPickService : INService
public class PlantPickService : INService, IExecNoCommand
{
//channelId/last generation
public ConcurrentDictionary<ulong, DateTime> LastGenerations { get; } = new();
@@ -49,8 +50,7 @@ public class PlantPickService : INService
_rng = new();
_client = client;
_gss = gss;
cmd.OnMessageNoTrigger += PotentialFlowerGeneration;
using var uow = db.GetDbContext();
var guildIds = client.Guilds.Select(x => x.Id).ToList();
var configs = uow.Set<GuildConfig>()
@@ -62,6 +62,9 @@ public class PlantPickService : INService
_generationChannels = new(configs.SelectMany(c => c.GenerateCurrencyChannelIds.Select(obj => obj.ChannelId)));
}
public Task ExecOnNoCommandAsync(IGuild guild, IUserMessage msg)
=> PotentialFlowerGeneration(msg);
private string GetText(ulong gid, LocStr str)
=> _strings.GetText(str, gid);