-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(anilist): add share button for hidden responses (#245)
- Loading branch information
Showing
13 changed files
with
266 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { anilistAnimeGet, anilistMangaGet, handleAniListResult } from '#lib/anilist'; | ||
import { InteractionHandler, type Interactions } from '@skyra/http-framework'; | ||
|
||
export class UserHandler extends InteractionHandler { | ||
public async run(interaction: Interactions.MessageComponentButton, parameters: Parameters) { | ||
const kind = parameters[0]; | ||
const hideDescription = parameters[1]; | ||
const id = Number(parameters[2]); | ||
|
||
const result = await (kind === 'anime' ? anilistAnimeGet : anilistMangaGet)(id); | ||
const response = handleAniListResult({ | ||
interaction, | ||
result, | ||
kind, | ||
hideDescription: hideDescription === '1', | ||
hide: false | ||
}); | ||
|
||
return interaction.reply(response); | ||
} | ||
} | ||
|
||
type Parameters = [kind: 'anime' | 'manga', hideDescription: '0' | '1', id: `${number}`]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from '#lib/utilities/anilist/response'; | ||
export * from '#lib/utilities/anilist/types'; | ||
export * from '#lib/utilities/anilist/utilities'; |
Oops, something went wrong.