diff --git a/examples/deno/post.ts b/examples/deno/post.ts new file mode 100644 index 0000000..9fb4ab3 --- /dev/null +++ b/examples/deno/post.ts @@ -0,0 +1,6 @@ +import { client, login } from "./mod.ts"; + +await login(); + +const a = await client.timeline.retrieveFeed(); +console.log(a); diff --git a/socialvoid/methods/timeline.ts b/socialvoid/methods/timeline.ts index 0ed0f80..01e42d5 100644 --- a/socialvoid/methods/timeline.ts +++ b/socialvoid/methods/timeline.ts @@ -32,7 +32,7 @@ export class Timeline extends MethodBase { * * @param post The ID or instance of the post to be deleted. */ - delete(post: string | Post): Promise { + delete(post: string | Post): Promise { return this.client.invokeRequest( new Request("timeline.delete", { post: typeof post === "string" ? post : post.id, @@ -124,7 +124,7 @@ export class Timeline extends MethodBase { * * @param post The ID or instance of the post to like. */ - like(post: string | Post): Promise { + like(post: string | Post): Promise { return this.client.invokeRequest( new Request("timeline.like", { post: typeof post === "string" ? post : post.id, @@ -133,6 +133,20 @@ export class Timeline extends MethodBase { ); } + /** + * Likes an existing post on the timeline. + * + * @param post The ID or instance of the post to like. + */ + unlike(post: string | Post): Promise { + return this.client.invokeRequest( + new Request("timeline.unlike", { + post: typeof post === "string" ? post : post.id, + }), + true, + ); + } + /** * Returns an array of posts from the users timeline. *