Merge pull request #87 from AnonymusRaccoon/worker-services

Worker services
This commit is contained in:
Zoe Roux
2022-03-03 15:15:01 +01:00
committed by GitHub
4 changed files with 56 additions and 3 deletions
+30
View File
@@ -0,0 +1,30 @@
{
"name": "Anilist",
"actions": [],
"reactions": [
{
"name": "UpdateAbout",
"description": "Update the about you section.",
"params": [
{
"name": "about",
"type": "string",
"description": "The description on your profile."
}
],
"returns": []
},
{
"name": "ToggleFavourite",
"description": "Add or remove an anime fro your favorite.",
"params": [
{
"name": "animeID",
"type": "string",
"description": "The ID of the anime"
}
],
"returns": []
}
]
}
+23 -2
View File
@@ -42,7 +42,28 @@
"name": "Youtube_OnYtLike",
"description": "Event triggered on video like",
"params": [],
"returns": []
"returns": [
{
"name": "ID",
"description": "Youtube ID of the added video"
},
{
"name": "CHANNEL_ID",
"description": "Youtube ID of the channel the video was added to"
},
{
"name": "TITLE",
"description": "Title of the added video"
},
{
"name": "DESCRIPTION",
"description": "Description of the added video"
},
{
"name": "CHANNEL_TITLE",
"description": "Name of the channel the video belongs to"
}
]
},
{
"name": "Youtube_OnYtPlaylistAdd",
@@ -145,4 +166,4 @@
]
}
]
}
}
+2
View File
@@ -69,6 +69,8 @@ export enum ReactionType {
Pause,
// Anilist
ToggleFavourite,
UpdateAbout,
// Twitter
followUser,
postTweet,
replyToTweet,
+1 -1
View File
@@ -11,7 +11,7 @@ export class Anilist extends BaseService {
this._client = new GraphQLClient("https://graphql.anilist.co/");
}
@reaction(ReactionType.ToggleFavourite, ["about"])
@reaction(ReactionType.UpdateAbout, ["about"])
async updateAbout(params: any): Promise<PipelineEnv> {
await this._client.request(gql`
mutation($about: Int) {