Skip to content

Commit

Permalink
Make follow community take number as arg instead of object
Browse files Browse the repository at this point in the history
  • Loading branch information
SleeplessOne1917 committed Jul 9, 2023
1 parent 6ed4abb commit 80ba602
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ The actions are as follows, grouped by access level in ascending order:
- `reason` string
- `uploadImage(image: Buffer)`: Upload an image to pictrs. Returns a promise with an `UploadImageResponse`.
- `resolveObject(form: string | { community: string, instance: string })`: Resolves an object on a remote interest. Use this to federate with communities that aren't showing up on your instance yet. **Note**: If passing in a string, make sure it is in the format "!'community name'@'instance domain'".
- `followCommunity(community_id: number)`: Make your bot subscribe to a community.

#### Community moderator

Expand Down
2 changes: 1 addition & 1 deletion src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class LemmyBot {
})
}),
getCommunityId: (form) => this.#getId(form, 'Communities'),
followCommunity: ({ community_id }) =>
followCommunity: (community_id) =>
this.#performLoggedInBotAction({
logMessage: `Following community ID ${community_id}`,
action: () =>
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export type BotActions = {
/**
* Follows a community by its ID.
*/
followCommunity: (form: { community_id: number }) => Promise<void>;
followCommunity: (community_id: number) => Promise<void>;
/**
* Gets user ID by name.
*
Expand Down

0 comments on commit 80ba602

Please sign in to comment.