Skip to content

Commit

Permalink
feat: anilist anime next airing episode type
Browse files Browse the repository at this point in the history
  • Loading branch information
skuzow committed Aug 21, 2023
1 parent f905ac8 commit 760b33c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/commands/anime/anilist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import {
import ExtendedClient from '../../client/ExtendedClient.js';
import { client } from '../../index.js';
import axios from 'axios';
import { Anilist, AnimeEntry, NextAiringEpisode } from '../../types/Anilist.js';
import {
Anilist,
AnimeEntry,
AnimeNextAiringEpisode
} from '../../types/Anilist.js';

const ANILIST_GRAPHQL_URL = 'https://graphql.anilist.co';

Expand Down Expand Up @@ -100,7 +104,7 @@ function filterAiringAnimes(animes: AnimeEntry[]): AnimeField[] {
});
}

function generateAnimeValue(anime: NextAiringEpisode | null): string {
function generateAnimeValue(anime: AnimeNextAiringEpisode | null): string {
if (anime === null) return 'No airing episodes';
return (
'Episode ' +
Expand Down
4 changes: 2 additions & 2 deletions src/types/Anilist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export interface AnimeMedia {
title: AnimeTitle;
siteUrl: string;
coverImage: AnilistAvatar;
nextAiringEpisode: NextAiringEpisode | null;
nextAiringEpisode: AnimeNextAiringEpisode | null;
}

export interface AnimeTitle {
english: string;
}

export interface NextAiringEpisode {
export interface AnimeNextAiringEpisode {
id: number;
airingAt: number;
timeUntilAiring: number;
Expand Down

0 comments on commit 760b33c

Please sign in to comment.