Beispiel #1
0
        public async Task Award([Summary("The user to award.")] SocketGuildUser mention, [Summary("The amount to award."), Remainder] int amount = 1)
        {
            var botlog = await Context.Guild.GetTextChannelAsync(UserSettings.Channels.BotLogsId(Context.Guild.Id));

            if (Xml.CommandAllowed("award", Context))
            {
                await Context.Message.DeleteAsync();

                if (amount > 10)
                {
                    await Context.Channel.SendMessageAsync("That's too much to award! Try a smaller amount.");
                }
                else if (Moderation.IsModerator((IGuildUser)Context.Message.Author))
                {
                    UserSettings.Currency.Add(Context.Guild.Id, mention.Id, amount);
                    var embed = Embeds.LogAward((SocketGuildUser)Context.Message.Author, mention.Username, amount);
                    await botlog.SendMessageAsync("", embed : embed).ConfigureAwait(false);

                    embed = Embeds.Award((SocketGuildUser)Context.Message.Author, mention.Username, amount);
                    await Context.Channel.SendMessageAsync("", embed : embed).ConfigureAwait(false);
                }
                else
                {
                    await Context.Channel.SendMessageAsync(UserSettings.BotOptions.GetString("NoPermissionMessage", Context.Guild.Id));
                }
            }
        }