コード例 #1
0
        public async Task Mute(
            [Summary("The user to be muted.")]
            IUser user,
            [Summary("The length of the mute in minutes.\n(Default: 10)")]
            double period = 10,
            [Summary("The mute period span.\n(Default: Minutes)\n(Available: Seconds, Minutes, Hours, Days)")]
            Measure measure = Measure.Minutes,
            [Remainder]
            [Summary("The reason for the mute.\n(Default: \"No Reason Provided.\")")]
            string reason = "No Reason Provided.")
        {
            try
            {
                await _moderation.Mute(Context.Guild, user, Context.User, period, reason);

                await _moderation.StartTimer(Context.Guild, user, period, measure);

                var builders = await _log.CreateLog(user, Context.User, reason, Infraction.Mute);

                var channel = Context.Guild.GetChannel(Config.Log) as IMessageChannel;

                await channel.SendMessageAsync(embed : Embeds.CreateEmbed("Log", builders));

                await Context.Message.AddReactionAsync(new Emoji("✅"));
            }
            catch (Exception e)
            {
                await ReplyAsync(e.Message);
            }
        }
コード例 #2
0
        public async Task Ban(
            [Summary("The user to be banned.")]
            SocketUser user,
            [Summary("The number of days of messages to be deleted.\n(Default: 1)")]
            int prune = 1,
            [Remainder]
            [Summary("The reason for the ban.\n(Default: \"No Reason Provided.\")")]
            string reason = "No Reason Provided.")
        {
            try
            {
                await _moderation.Ban(Context.Guild, user, Context.User, prune, reason);

                var builders = await _log.CreateLog(user, Context.User, reason, Infraction.Ban);

                var channel = Context.Guild.GetChannel(Config.Log) as IMessageChannel;

                await channel.SendMessageAsync(embed : Embeds.CreateEmbed("Log", builders));

                await Context.Message.AddReactionAsync(new Emoji("✅"));
            }
            catch (Exception e)
            {
                await ReplyAsync(e.Message);
            }
        }
コード例 #3
0
ファイル: Utility.cs プロジェクト: ThumbTacc/Rid
 public async Task BotInfo()
 {
     try
     {
         var botInfo = _utility.ListBotInfo();
         await Context.Channel.SendMessageAsync(embed : Embeds.CreateEmbed("Bot Info", botInfo));
     }
     catch (Exception e)
     {
         await ReplyAsync(e.Message);
     }
 }
コード例 #4
0
ファイル: Help.cs プロジェクト: ThumbTacc/Rid
 public async Task Modules()
 {
     try
     {
         var modules = _help.ListModules();
         await Context.Channel.SendMessageAsync(embed : Embeds.CreateEmbed("Modules", modules));
     }
     catch (Exception e)
     {
         await ReplyAsync(e.Message);
     }
 }
コード例 #5
0
ファイル: Help.cs プロジェクト: ThumbTacc/Rid
 public async Task Commands(
     [Summary("The name of the module to be searched for.")]
     string moduleName)
 {
     try
     {
         var module   = _help.GetModuleInfo(moduleName);
         var commands = _help.ListCommands(module);
         await Context.Channel.SendMessageAsync(embed : Embeds.CreateEmbed(module.Name, commands));
     }
     catch (Exception e)
     {
         await ReplyAsync(e.Message);
     }
 }
コード例 #6
0
ファイル: Utility.cs プロジェクト: ThumbTacc/Rid
        public async Task GuildInfo()
        {
            try
            {
                var guildDictionary = _utility.GetGuildInfo(Context.Guild);
                var guildInfo       = _utility.ListGuildInfo(guildDictionary);

                var created = Context.Guild.CreatedAt.ToString("f");
                var icon    = Context.Guild.IconUrl;

                await Context.Channel.SendMessageAsync(embed : Embeds.CreateEmbed($"{Context.Guild.Name} Info", guildInfo, $"Created on: {created}", icon));
            }
            catch (Exception e)
            {
                await ReplyAsync(e.Message);
            }
        }
コード例 #7
0
        public async Task Warn(
            [Summary("The user to be warned.")]
            IUser user,
            [Remainder]
            [Summary("The reason for the warn.\n(Default: \"No Reason Provided.\")")]
            string reason = "No Reason Provided.")
        {
            try
            {
                var builders = await _log.CreateLog(user, Context.User, reason, Infraction.Warn);

                var channel = Context.Guild.GetChannel(Config.Log) as IMessageChannel;

                await channel.SendMessageAsync(embed : Embeds.CreateEmbed("Log", builders));

                await Context.Message.AddReactionAsync(new Emoji("✅"));
            }
            catch (Exception e)
            {
                await ReplyAsync(e.Message);
            }
        }
コード例 #8
0
ファイル: Help.cs プロジェクト: ThumbTacc/Rid
 public async Task CommandHelp(
     [Summary("The name of the command to be searched for.")]
     string commandName = null)
 {
     try
     {
         if (commandName != null)
         {
             var command = _help.GetCommandInfo(commandName);
             var info    = _help.ListCommandHelp(command);
             await Context.Channel.SendMessageAsync(embed : Embeds.CreateEmbed(command.Name, info));
         }
         else
         {
             var info = _help.ListGeneralHelp();
             await Context.Channel.SendMessageAsync(embed : Embeds.CreateEmbed("Help", info));
         }
     }
     catch (Exception e)
     {
         await ReplyAsync(e.Message);
     }
 }