Beispiel #1
0
        private async Task QRPKM(IAttachment att)
        {
            var download = await NetUtil.DownloadPKMAsync(att).ConfigureAwait(false);

            if (!download.Success)
            {
                await ReplyAsync(download.ErrorMessage).ConfigureAwait(false);

                return;
            }

            var pkm     = download.Data;
            var finalQR = Sprites.GetFullQR(pkm);
            var msg     = $"Here's the QR for {download.SanitizedFileName}!";
            await Context.Channel.SendImageAsync(finalQR, msg).ConfigureAwait(false);
        }
Beispiel #2
0
        public static async Task RepostPKMAsShowdownAsync(this ISocketMessageChannel channel, IAttachment att)
        {
            if (!PKX.IsPKM(att.Size))
            {
                return;
            }
            var result = await NetUtil.DownloadPKMAsync(att).ConfigureAwait(false);

            if (!result.Success)
            {
                return;
            }

            var pkm = result.Data;
            await channel.SendPKMAsShowdownSetAsync(pkm).ConfigureAwait(false);
        }