Пример #1
0
            public async Task Manga(IUserMessage umsg, [Remainder] string query)
            {
                var channel = (ITextChannel)umsg.Channel;

                if (string.IsNullOrWhiteSpace(query))
                {
                    return;
                }

                var mangaData = await GetMangaData(query).ConfigureAwait(false);

                if (mangaData == null)
                {
                    await umsg.Channel.SendErrorAsync("Failed finding that mango.").ConfigureAwait(false);

                    return;
                }

                var embed = new Discord.API.Embed()
                {
                    Description = mangaData.Synopsis,
                    Title       = mangaData.title_english,
                    Url         = mangaData.Link,
                    Image       = new Discord.API.EmbedImage()
                    {
                        Url = mangaData.image_url_lge
                    },
                    Fields = new[] {
                        new Discord.API.EmbedField()
                        {
                            Inline = true,
                            Name   = "Chapters",
                            Value  = mangaData.total_chapters.ToString()
                        },
                        new Discord.API.EmbedField()
                        {
                            Inline = true,
                            Name   = "Status",
                            Value  = mangaData.publishing_status.ToString()
                        },
                        new Discord.API.EmbedField()
                        {
                            Inline = true,
                            Name   = "Genres",
                            Value  = String.Join(", ", mangaData.Genres)
                        }
                    },
                    Color = NadekoBot.OkColor
                };

                await channel.EmbedAsync(embed).ConfigureAwait(false);
            }
Пример #2
0
            public async Task Anime(IUserMessage umsg, [Remainder] string query)
            {
                var channel = (ITextChannel)umsg.Channel;

                if (string.IsNullOrWhiteSpace(query))
                {
                    return;
                }

                var animeData = await GetAnimeData(query).ConfigureAwait(false);

                var embed = new Discord.API.Embed()
                {
                    Description = animeData.Synopsis,
                    Title       = animeData.title_english,
                    Url         = animeData.Link,
                    Image       = new Discord.API.EmbedImage()
                    {
                        Url = animeData.image_url_lge
                    },
                    Fields = new[] {
                        new Discord.API.EmbedField()
                        {
                            Inline = true,
                            Name   = "Episodes",
                            Value  = animeData.total_episodes.ToString()
                        },
                        new Discord.API.EmbedField()
                        {
                            Inline = true,
                            Name   = "Status",
                            Value  = animeData.AiringStatus.ToString()
                        },
                        new Discord.API.EmbedField()
                        {
                            Inline = true,
                            Name   = "Genres",
                            Value  = String.Join(", ", animeData.Genres)
                        }
                    },
                    Color = NadekoBot.OkColor
                };
                await channel.EmbedAsync(embed).ConfigureAwait(false);
            }
Пример #3
0
            public async Task Anime(IUserMessage umsg, [Remainder] string query)
            {
                var channel = (ITextChannel)umsg.Channel;

                if (string.IsNullOrWhiteSpace(query))
                    return;

                var animeData = await GetAnimeData(query).ConfigureAwait(false);

                var embed = new Discord.API.Embed()
                {
                    Description = animeData.Synopsis,
                    Title = animeData.title_english,
                    Url = animeData.Link,
                    Image = new Discord.API.EmbedImage() {
                        Url = animeData.image_url_lge
                    },
                    Fields = new[] {
                        new Discord.API.EmbedField() {
                            Inline = true,
                            Name = "Episodes",
                            Value = animeData.total_episodes.ToString()
                        },
                        new Discord.API.EmbedField() {
                            Inline = true,
                            Name = "Status",
                            Value =  animeData.AiringStatus.ToString()
                        },
                        new Discord.API.EmbedField() {
                            Inline = true,
                            Name = "Genres",
                            Value = String.Join(", ", animeData.Genres)
                        }
                    },
                    Color = NadekoBot.OkColor
                };
                await channel.EmbedAsync(embed).ConfigureAwait(false);
            }
Пример #4
0
 public static Task <IUserMessage> EmbedAsync(this IMessageChannel ch, Discord.API.Embed embed)
 => ch.SendMessageAsync("", embed: embed);
Пример #5
0
 public static Task <IUserMessage> EmbedAsync(this IMessageChannel ch, Discord.API.Embed embed, string msg = "")
 => ch.SendMessageAsync(msg, embed: embed);