Skip to content

Commit

Permalink
refactor: better axios request anilist command
Browse files Browse the repository at this point in the history
  • Loading branch information
skuzow committed Aug 21, 2023
1 parent fb52325 commit 6c8ab56
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/commands/anime/anilist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,9 @@ async function processQuery(
}

async function requestQuery(username: string): Promise<Anilist> {
return axios({
url: ANILIST_GRAPHQL_URL,
method: 'post',
data: { query: generateQuery(username) }
}).then((response: AxiosResponse) => response.data.data.MediaListCollection);
return axios
.post(ANILIST_GRAPHQL_URL, { query: generateQuery(username) })
.then((response: AxiosResponse) => response.data.data.MediaListCollection);
}

function generateInfoEmbed(response: Anilist): EmbedBuilder {
Expand Down

0 comments on commit 6c8ab56

Please sign in to comment.