Пример #1
0
        public static async void ClearWarn(SocketGuildUser moderator, ITextChannel channel, int index, SocketGuildUser user)
        {
            //Get warn userId and description
            Tuple <string, string> tuple = UserSettings.Warns.Get(channel.Guild.Id, index);
            string removedWarn           = tuple.Item1 + " " + tuple.Item2;

            //Announce clearing of warns in both channel and bot-logs
            var embed = Embeds.ClearWarn(moderator, removedWarn);
            await channel.SendMessageAsync("", embed : embed).ConfigureAwait(false);

            var botlog = await channel.Guild.GetTextChannelAsync(UserSettings.Channels.BotLogsId(moderator.Guild.Id));

            if (botlog != null)
            {
                await botlog.SendMessageAsync("", embed : embed).ConfigureAwait(false);
            }

            //Write new warns list to file
            UserSettings.Warns.Remove(channel.Guild.Id, index);
        }