Example #1
0
        public async Task MemeAsync()
        {
            var previousMsg = await _misc.GetPreviousMessageAsync(Context.Channel as SocketTextChannel);

            if (string.IsNullOrEmpty(previousMsg.Content))
            {
                return;
            }

            var url = (await _img.GetRedditImageAsync("earthporn", Context.Guild.Id, false)).Url;
            var img = await _img.DrawTextAsync(url, previousMsg.Content.Replace("\\", ""));

            _img.BackgroundColor(img, _rand.RandomNumber(0, 255), _rand.RandomNumber(0, 255), _rand.RandomNumber(0, 255));
            _img.Saturate(img, _rand.RandomFloat(5));
            _img.Brightness(img, _rand.RandomFloat(1, 5));
            _img.Blur(img, _rand.RandomFloat(5));
            _img.Pixelate(img, _rand.RandomNumber(1, 4));
            _img.Sharpen(img, _rand.RandomFloat(5));
            _img.Jpeg(img, _rand.RandomNumber(1, 15));

            await _img.SendToChannelAsync(img, Context.Channel, new MessageReference(Context.Message.Id));
        }