mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
add: added .notify with no params showing events with descriptions add: .winlb docs: updated docs dev: updated discord.net, redid migrations
38 lines
929 B
C#
38 lines
929 B
C#
using NadekoBot.Db.Models;
|
|
|
|
namespace NadekoBot.Modules.Administration;
|
|
|
|
public record struct LevelUpNotifyModel(
|
|
ulong GuildId,
|
|
ulong ChannelId,
|
|
ulong UserId,
|
|
long Level) : INotifyModel
|
|
{
|
|
public static string KeyName
|
|
=> "notify.levelup";
|
|
|
|
public static NotifyType NotifyType
|
|
=> NotifyType.LevelUp;
|
|
|
|
public IReadOnlyDictionary<string, Func<SocketGuild, string>> GetReplacements()
|
|
{
|
|
var data = this;
|
|
return new Dictionary<string, Func<SocketGuild, string>>()
|
|
{
|
|
{ "%event.level%", g => data.Level.ToString() },
|
|
{ "%event.user%", g => g.GetUser(data.UserId)?.ToString() ?? data.UserId.ToString() },
|
|
};
|
|
}
|
|
|
|
public bool TryGetGuildId(out ulong guildId)
|
|
{
|
|
guildId = GuildId;
|
|
return true;
|
|
}
|
|
|
|
public bool TryGetUserId(out ulong userId)
|
|
{
|
|
userId = UserId;
|
|
return true;
|
|
}
|
|
} |