Esempio n. 1
0
        private async Task <bool> GenerateMovieLastWeek(ulong guildId, SocketTextChannel channel)
        {
            string fileName = await MovieHelper.GenerateMovieForMessages(guildId, 24 * 7, 30, -1, 10, true, true, "");

            await channel.SendFileAsync(fileName, "Message graph for last week");

            return(true);
        }
Esempio n. 2
0
        public async Task SocialCreditGraph()
        {
            var author = Context.Message.Author;

            if (author.Id != Program.ApplicationSetting.Owner)
            {
                await Context.Channel.SendMessageAsync("You aren't allowed to run this command", false);

                return;
            }

            List <SocialCreditUser> users = new List <SocialCreditUser>();

            using (var connection = new SqliteConnection("Data Source=C:\\AprilFoolsBot\\test.db"))
            {
                connection.Open();

                var command = connection.CreateCommand();
                command.CommandText =
                    @"SELECT * FROM DiscordUsers";
                //command.Parameters.AddWithValue("$id", id);

                using (var reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var id   = Convert.ToUInt64(reader.GetString(0));
                        var name = reader.GetString(1);
                        users.Add(new SocialCreditUser()
                        {
                            Id           = id, Name = name,
                            Transactions = new List <SocialCreditTransaction>()
                            {
                            }
                        });
                    }
                }
            }

            try
            {
                string fileName = await MovieHelper.GenerateMovieForMessages(Context.Guild.Id, 24 * 7, 30, -1, 15, true, true);

                await Context.Channel.SendFileAsync(fileName);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Error while creating movie");
                await Context.Channel.SendMessageAsync(ex.ToString());
            }
        }
Esempio n. 3
0
        public async Task CreateMovieLastWeek()
        {
            var author = Context.Message.Author;

            if (author.Id != Program.ApplicationSetting.Owner)
            {
                await Context.Channel.SendMessageAsync("You aren't allowed to run this command", false);

                return;
            }

            try
            {
                string fileName = await MovieHelper.GenerateMovieForMessages(Context.Guild.Id, 24 * 7, 30, -1, 15, true, true);

                await Context.Channel.SendFileAsync(fileName);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Error while creating movie");
                await Context.Channel.SendMessageAsync(ex.ToString());
            }
        }
Esempio n. 4
0
        public async Task CreateMovie(bool stacked, int groupByHours, int fps, bool drawDots, params ulong[] channelIds)
        {
            var author = Context.Message.Author;

            if (author.Id != Program.ApplicationSetting.Owner)
            {
                await Context.Channel.SendMessageAsync("You aren't allowed to run this command", false);

                return;
            }

            try
            {
                string fileName = await MovieHelper.GenerateMovieForMessages(Context.Guild.Id, -1, fps, groupByHours, -1, stacked, drawDots, "", channelIds);

                await Context.Channel.SendFileAsync(fileName);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Error while creating movie");
                await Context.Channel.SendMessageAsync(ex.ToString());
            }
        }