add: Added .notify and migrations, added levelup and protection events for notify, removed xpnotify completely

This commit is contained in:
Kwoth
2024-12-05 14:35:42 +00:00
parent 0f240925e8
commit 0622236523
25 changed files with 625 additions and 244 deletions

View File

@@ -51,26 +51,6 @@ public partial class Xp : NadekoModule<XpService>
}
}
[Cmd]
[RequireContext(ContextType.Guild)]
public async Task XpNotify()
{
var globalSetting = _service.GetNotificationType(ctx.User);
var embed = CreateEmbed()
.WithOkColor()
.AddField(GetText(strs.xpn_setting_global), GetNotifLocationString(globalSetting));
await Response().Embed(embed).SendAsync();
}
[Cmd]
public async Task XpNotify(XpNotificationLocation type)
{
await _service.ChangeNotificationType(ctx.User, type);
await ctx.OkAsync();
}
[Cmd]
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.Administrator)]
@@ -615,15 +595,4 @@ public partial class Xp : NadekoModule<XpService>
await _service.UseShopItemAsync(ctx.User.Id, type, key);
}
}
private string GetNotifLocationString(XpNotificationLocation loc)
{
if (loc == XpNotificationLocation.Channel)
return GetText(strs.xpn_notif_channel);
if (loc == XpNotificationLocation.Dm)
return GetText(strs.xpn_notif_dm);
return GetText(strs.xpn_notif_disabled);
}
}