Gab
Constructor Summary
Public Constructor | ||
public |
constructor(options: *) Create a new Gab client. |
Member Summary
Public Members | ||
public |
options: * |
Method Summary
Public Methods | ||
public |
createMediaAttachment(file: *): Promise<object, string> Creates a media attachment. |
|
public |
createPost(options: *): Promise<object, string> Create a new post. |
|
public |
Downvote a post. |
|
public |
Follow a user. |
|
public |
Returns a user's followers. Requires 'read' scope. |
|
public |
Returns a user's followed. Requires 'read' scope. |
|
public |
groupDetails(groupId: *): Promise<object, string> Returns a group's details. Requires the 'read' scope. |
|
public |
groupModerationLogs(groupId: *): Promise<object, string> Returns a group's moderation logs. Requires the 'read' scope. |
|
public |
groupUsers(groupId: *, before: *): Promise<object, string> Returns a group's users. Requires the 'read' scope. |
|
public |
|
|
public |
me(): * Returns the user's account information. Requires 'read' scope. |
|
public |
notifications(before: *): Promise<object, string> Returns a user's notifications. Requires 'notifications' scope. |
|
public |
popularFeed(): Promise<object, string> Returns the popular feed. |
|
public |
popularGroups(): Promise<object, string> Returns popular groups. |
|
public |
popularUsers(): Promise<object, string> Returns popular users. |
|
public |
postDetails(postId: *): Promise<object, string> Returns a post's details. Requires the 'engage-post' scope. |
|
public |
removeDownvote(postId: *): Promise<object, string> Remove a downvote for a post. |
|
public |
removeRepost(postId: *): Promise<object, string> Remove a repost. |
|
public |
removeUpvote(postId: *): Promise<object, string> Remove an upvote for a post. |
|
public |
Repost a post. |
|
public |
Unfollow a user. |
|
public |
Upvote a post. |
|
public |
Returns a user's profile. Requires 'read' scope. |
|
public |
Returns a user's feed. Requires the 'read' scope. |
Public Constructors
public constructor(options: *) source
Create a new Gab client.
Params:
Name | Type | Attribute | Description |
options | * | ||
options.authToken | * | User's auth token. |
|
options.stringify | * | (Optional) If true, will return stringified JSON. |
|
options.timeout | * | (Optional) Specify a custom timeout. Default 5000 milliseconds. |
Public Members
public options: * source
Public Methods
public createMediaAttachment(file: *): Promise<object, string> source
Creates a media attachment. Requires the 'write-posts' scope.
Params:
Name | Type | Attribute | Description |
file | * |
public createPost(options: *): Promise<object, string> source
Create a new post.
Params:
Name | Type | Attribute | Description |
options | * | ||
options.media_attachments[] | * | Media attachment ID created using createMediaAttachment. Up to four attachments. |
|
options.gif | * | Giphy gif ID |
|
options.body | * | Post body |
|
options.reply_to | * | Id of the post to reply to. |
|
options.is_quote | * | 1 if you want to create this as a quote. |
|
options.nsfw | * | 1 if post is NSFW. |
|
options.premium_min_tier | * | Used to mark a premium post. Amount, in cents, that user's should pay monthly for this post to be visible. |
|
options.group | * | ID of group to post to. |
|
options.topic | * | Topic for the post. |
|
options.poll | * | 1 if you want to add a poll. Requires poll_option_1 and poll_option_2. poll_option_3 and poll_option_4 are optional. |
|
options.poll_option_1 | * | Poll option |
|
options.poll_option_2 | * | Poll option |
|
options.poll_option_3 | * | Poll option |
|
options.poll_option_4 | * | Poll option |
public downvote(postId: *): Promise<object, string> source
Downvote a post. Requires the 'engage-post' scope.
Params:
Name | Type | Attribute | Description |
postId | * |
public follow(userId: *): Promise<object, string> source
Follow a user. Requires the 'engage-user' scope.
Params:
Name | Type | Attribute | Description |
userId | * |
public followers(username: *, before: *): Promise<object, string> source
Returns a user's followers. Requires 'read' scope.
Params:
Name | Type | Attribute | Description |
username | * | ||
before | * |
public following(username: *, before: *): Promise<object, string> source
Returns a user's followed. Requires 'read' scope.
Params:
Name | Type | Attribute | Description |
username | * | ||
before | * |
public groupDetails(groupId: *): Promise<object, string> source
Returns a group's details. Requires the 'read' scope.
Params:
Name | Type | Attribute | Description |
groupId | * |
public groupModerationLogs(groupId: *): Promise<object, string> source
Returns a group's moderation logs. Requires the 'read' scope.
Params:
Name | Type | Attribute | Description |
groupId | * |
public groupUsers(groupId: *, before: *): Promise<object, string> source
Returns a group's users. Requires the 'read' scope.
Params:
Name | Type | Attribute | Description |
groupId | * | ||
before | * |
public mainFeed(before: string): * source
Params:
Name | Type | Attribute | Description |
before | string |
|
Return:
* |
public notifications(before: *): Promise<object, string> source
Returns a user's notifications. Requires 'notifications' scope.
Params:
Name | Type | Attribute | Description |
before | * |
public popularFeed(): Promise<object, string> source
Returns the popular feed. Requires the 'read' scope.
public popularGroups(): Promise<object, string> source
Returns popular groups. Requires the 'read' scope.
public popularUsers(): Promise<object, string> source
Returns popular users. Requires the 'read' scope.
public postDetails(postId: *): Promise<object, string> source
Returns a post's details. Requires the 'engage-post' scope.
Params:
Name | Type | Attribute | Description |
postId | * |
public removeDownvote(postId: *): Promise<object, string> source
Remove a downvote for a post. Requires the 'engage-post' scope.
Params:
Name | Type | Attribute | Description |
postId | * |
public removeRepost(postId: *): Promise<object, string> source
Remove a repost. Requires the 'engage-post' scope.
Params:
Name | Type | Attribute | Description |
postId | * |
public removeUpvote(postId: *): Promise<object, string> source
Remove an upvote for a post. Requires the 'engage-post' scope.
Params:
Name | Type | Attribute | Description |
postId | * |
public repost(postId: *): Promise<object, string> source
Repost a post. Requires the 'engage-post' scope.
Params:
Name | Type | Attribute | Description |
postId | * |
public unfollow(userId: *): Promise<object, string> source
Unfollow a user. Requires the 'engage-user' scope.
Params:
Name | Type | Attribute | Description |
userId | * |
public upvote(postId: *): Promise<object, string> source
Upvote a post. Requires the 'engage-post' scope.
Params:
Name | Type | Attribute | Description |
postId | * |