Esempio n. 1
0
        public HelpFormatter(CommandContext ctx, Roblot Bot) : base(ctx)
        {
            this.bot            = Bot;
            this.finalMessage   = new StringBuilder();
            this.roblotCommands = new StringBuilder();
            this.musicCommands  = new StringBuilder();
            this.moneyCommands  = new StringBuilder();

            vidya = new VidyaListRandomizer();

            this.finalMessage.AppendLine(Formatter.BlockCode(vidya.getCompanyReview(), "fix")).AppendLine();
        }
Esempio n. 2
0
        /// <summary>
        /// Async entry point for the bot
        /// </summary>
        /// <param name="args"> args from Main </param>
        /// <returns></returns>
        private static async Task MainAsync(string[] args)
        {
            // Load the config file
            var json = "";

            using (var fs = File.OpenRead("config.json"))
                using (var sr = new StreamReader(fs, new UTF8Encoding(false)))
                    json = await sr.ReadToEndAsync();

            var cfgjson = JsonConvert.DeserializeObject <ConfigJson>(json);

            // Instantiate a new roblot class
            var roblotInstance = new Roblot(cfgjson);
            // Run Roblot
            await roblotInstance.StartAsync().ConfigureAwait(false);

            // Wait forever
            await Task.Delay(-1);
        }