Exemplo n.º 1
0
        private async Task BlackWhite(CommandReplyEmbed embedrep, SocketMessage msg, List <string> args)
        {
            string url  = string.IsNullOrWhiteSpace(args[0]) ? Handler.GetLastPictureURL((msg.Channel as SocketChannel)) : args[0];
            string path = null;

            if (!string.IsNullOrWhiteSpace(url)) //if getlastpicture returns nothing
            {
                path = await ImageProcess.DownloadImage(url);
            }

            if (path != null)
            {
                try
                {
                    ImageProcess.Resize(path);
                    ImageProcess.MakeBlackWhite(path);

                    await msg.Channel.SendFileAsync(path);

                    ImageProcess.DeleteImage(path);
                }catch (Exception e)
                {
                    BotLog.Debug(e.ToString());
                }
            }

            if (path == null)
            {
                await embedrep.Danger(msg, "Ugh", "There's no valid url to use!");
            }
        }
Exemplo n.º 2
0
        private async Task Wew(CommandReplyEmbed embedrep, SocketMessage msg, List <string> args)
        {
            string url      = string.IsNullOrWhiteSpace(args[0]) ? Handler.GetLastPictureURL((msg.Channel as SocketChannel)) : args[0];
            string path     = null;
            string maskpath = "Masks/wew.png";

            if (!string.IsNullOrWhiteSpace(url)) //if getlastpicture returns nothing
            {
                path = await ImageProcess.DownloadImage(url);
            }

            if (path != null)
            {
                await embedrep.Good(msg, "WIP", "Sorry this command is under work!");
            }

            if (path == null)
            {
                await embedrep.Danger(msg, "Ugh", "There's no valid url to use!");
            }
        }