Ejemplo n.º 1
0
        static async Task MainAsync(string[] args)
        {
            await EBotCredentials.Load();

            EBotClient client = new EBotClient(EBotCredentials.TOKEN_MAIN, "_");

            await client.ConnectAsync();

            await Task.Delay(-1);
        }
Ejemplo n.º 2
0
        public EBotClient(string token, string prefix)
        {
            Console.Clear();
            Console.Title = "EBot's Logs";

            this._Token       = token;
            this._Prefix      = prefix;
            this._Log         = new BotLog();
            this._Event       = new LogEvent();
            this._Spy         = new SpyLog();
            this._Handler     = new CommandsHandler();
            this._Source      = new CommandSource(this._Handler, this._Log);
            this._Discord     = new DiscordSocketClient();
            this._DiscordREST = new DiscordRestClient();

            this._Log.Nice("Config", ConsoleColor.Yellow, "Token used => [ " + token + " ]");
            this._Log.Notify("Initializing");

            this._Handler.Client         = this._Discord;
            this._Handler._RESTClient    = this._DiscordREST;
            this._Handler.Log            = this._Log;
            this._Handler.Prefix         = this._Prefix;
            this._Handler.Source         = this._Source;
            this._Handler.EmbedReply.Log = this._Log;
            this._Handler.Initialize();

            this._Spy.Client     = this._Discord;
            this._Spy.RESTClient = this._DiscordREST;
            this._Spy.Log        = this._Log;
            this._Spy.WatchWords(new string[] { "yara", "earu" });

            this._Event.Client     = this._Discord;
            this._Event.RESTClient = this._DiscordREST;
            this._Event.Prefix     = this._Prefix;
            this._Event.Log        = this._Log;
            this._Event.InitEvents();

            CLIENT = this;
        }