예제 #1
0
        static void Main(string[] args)
        {
            FunCommands funCommands = new FunCommands();
            var         Bot         = new Bot();

            Bot.RunAsync().GetAwaiter().GetResult();
        }
예제 #2
0
        public CommandSource(CommandsHandler handler, BotLog log)
        {
            this._Utils    = new UtilsCommands();
            this._Social   = new SocialCommands();
            this._NSFW     = new NSFWCommands();
            this._Search   = new SearchCommands();
            this._Image    = new ImageCommands();
            this._Fun      = new FunCommands();
            this._Warframe = new WarframeCommands();

            Setup(handler, log);
        }
예제 #3
0
 // Sets up all the command hooks
 public static void Init()
 {
     DevCommands.Init();
     ModerationCommands.Init();
     BuildingCommands.Init();
     InfoCommands.Init();
     WorldCommands.Init();
     ZoneCommands.Init();
     MaintenanceCommands.Init();
     ChatCommands.Init();
     FunCommands.Init();
     MathCommands.Init();
     Logger.Log(LogType.Debug,
                "CommandManager: {0} commands registered ({1} hidden, {2} aliases)",
                Commands.Count,
                GetCommands(true).Length,
                Aliases.Count);
 }
예제 #4
0
파일: ClasherDynBot.cs 프로젝트: tkirit/bot
        public ClasherDynBot()
        {
            rand    = new Random();
            discord = new DiscordClient(x =>
            {
                x.LogLevel   = LogSeverity.Info;
                x.LogHandler = Log;
            });

            discord.UsingCommands(x =>
            {
                x.PrefixChar         = '!';
                x.AllowMentionPrefix = true;
            });

            commands = discord.GetService <CommandService>();

            #region register command groups
            HelpCommands.RegisterHelpCommands(commands, discord);
            FunCommands.RegisterFunCommands(commands, discord);
            SettingCommands.RegisterWebsiteCommands(commands, discord);
            SearchCommands.RegisterSearchCommands(commands, discord);
            AttendanceCommands.RegisterAttendanceCommands(commands, discord);
            WarningCommands.RegisterWarningCommands(commands, discord);
            EnemyNoteCommands.RegisterEnemyNoteCommands(commands, discord);
            WarCommands.RegisterWarCommands(commands, discord);
            AdminCommands.RegisterAdminCommands(commands, discord);
            #endregion

            discord.ExecuteAndWait(async() =>
            {
                string key = ConfigurationManager.AppSettings["Key"];
                await discord.Connect(key, Discord.TokenType.Bot);
                //auto start notifications
                await StartNotifications();
            });
        }