currency levelup rewards wip
This commit is contained in:
@ -23,34 +23,10 @@ namespace NadekoBot.Modules.Xp
|
||||
_client = client;
|
||||
_db = db;
|
||||
}
|
||||
|
||||
//[NadekoCommand, Usage, Description, Aliases]
|
||||
//[RequireContext(ContextType.Guild)]
|
||||
//[OwnerOnly]
|
||||
//public async Task Populate()
|
||||
//{
|
||||
// var rng = new NadekoRandom();
|
||||
// using (var uow = _db.UnitOfWork)
|
||||
// {
|
||||
// for (var i = 0ul; i < 1000000; i++)
|
||||
// {
|
||||
// uow.DiscordUsers.Add(new DiscordUser()
|
||||
// {
|
||||
// AvatarId = i.ToString(),
|
||||
// Discriminator = "1234",
|
||||
// UserId = i,
|
||||
// Username = i.ToString(),
|
||||
// Club = null,
|
||||
// });
|
||||
// var xp = uow.Xp.GetOrCreateUser(Context.Guild.Id, i);
|
||||
// xp.Xp = rng.Next(100, 100000);
|
||||
// }
|
||||
// uow.Complete();
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
//todo add ratelimit attribute
|
||||
//[Ratelimit(30)]
|
||||
public async Task Experience([Remainder]IUser user = null)
|
||||
{
|
||||
@ -82,7 +58,7 @@ namespace NadekoBot.Modules.Xp
|
||||
.Take(9);
|
||||
|
||||
var embed = new EmbedBuilder()
|
||||
.WithTitle(GetText("role_rewards"))
|
||||
.WithTitle(GetText("level_up_rewards"))
|
||||
.WithOkColor();
|
||||
|
||||
if (!roles.Any())
|
||||
@ -116,6 +92,21 @@ namespace NadekoBot.Modules.Xp
|
||||
await ReplyConfirmLocalized("role_reward_added", level, Format.Bold(role.ToString())).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task XpCurrencyReward(int level, int amount=0)
|
||||
{
|
||||
if (level < 1 || amount < 0)
|
||||
return;
|
||||
|
||||
_service.SetCurrencyReward(Context.Guild.Id, level, amount);
|
||||
|
||||
if (amount == 0)
|
||||
await ReplyConfirmLocalized("cur_reward_cleared", level).ConfigureAwait(false);
|
||||
else
|
||||
await ReplyConfirmLocalized("cur_reward_added", level, Format.Bold(amount.ToString())).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public enum NotifyPlace
|
||||
{
|
||||
Server = 0,
|
||||
|
Reference in New Issue
Block a user