description |
---|
The Guilded Bot's client, where everything's happen and where the Guilded bot interacts with guilds/servers. |
Property | Description | Type |
---|---|---|
params | The bot's options you set when you're creating a new client. (includes token) | Object |
identifiers | Names of all standard Guilded events and their equivalent in simple types. | Object |
ws | The WebSocket manager used to connect to the API. | WSManager |
cache | The client's cache, used for storing things such as message contents | Map |
calls | -- | -- |
token | The bot's inserted token. | String |
user | Logged bot's user. | UserClient |
new Client(params)
Properties | Description | Type | Required? |
---|---|---|---|
params | Client's parameters/options. | Object | true |
params.token | Bot's token | String | true |
params.REST | Enable/disable REST methods, it is enabled by default. | Boolean | false |
{% hint style="info" %} Client have standard event emitter types, they're not listed there. {% endhint %}
Connects your bot to the Guilded API.
Disconnect the client from the Guilded API.
Properties | Description | Type |
---|---|---|
crashOnDisconnect? | If true, it'll crash when executing the method. If false, it'll only log the action. (default: false) |
Boolean |
Get a specific channel's information.
Properties | Description | Type |
---|---|---|
channelID | id of the channel you'd like to get. | String |
Returns: Promise<Channel>
Get a specific guild's/server's member.
Properties | Description | Type |
---|---|---|
guildID | id of the server | String |
memberID | id of the user | String |
Returns: Promise<Member>
Get a specific guild/server.
Properties | Description | Type |
---|---|---|
guildID | id of the server | String |
Returns: Promise<Guild>
Get a list channel Message component.
Properties | Description | Type |
---|---|---|
channelID | id of the channel | String |
filter? | filter channel messages | Object |
filter.before? | Date-time string | String |
filter.after? | Date-time string | String |
filter.limit? | Limit the channel message output | Number |
filter.includePrivate? | Include private messages or not | Boolean |
Returns: Promise<Array<Message>>
Get a list of channel Doc component.
Properties | Description | Type |
---|---|---|
channelID | id of the channel | String |
filter? | filter channel docs | Object |
filter.before? | Date-time string | String |
filter.limit? | Limit the channel doc output | Number |
Returns: Promise<Array<Doc>>
Get a specific channel doc.
Properties | Description | Type |
---|---|---|
channelID | id of the channel | String |
docID | id of the doc | Number |
Returns: Promise<Doc>
Get a list of ForumTopic component.
Properties | Description | Type |
---|---|---|
channelID | id of the forum channel | String |
filter? | filter forum topics | Object |
filter.before? | Date-time string | String |
filter.limit? | Limit the forum topic output (improves response time) | Number |
Returns: Promise<Array<ForumTopic>>
Get a specific ForumTopic component
Properties | Description | Type |
---|---|---|
channelID | id of the forum channel | String |
topicID | id of the forum topic | Number |
Returns: Promise<ForumTopic>
Get a list of ForumTopicComment component.
Properties | Description | Type |
---|---|---|
channelID | id of the forum channel | String |
topicID | id of the forum topic topic | Number |
Returns: Promise<Array<ForumTopicComment>>
Get a specific ForumTopicComment component
Properties | Description | Type |
---|---|---|
channelID | id of the forum channel | String |
topicID | id of the forum topic topic | Number |
commentID | id of the topic comment | Number |
Returns: Promise<ForumTopicComment>
Get a list of CalendarEvent component
Properties | Description | Type |
---|---|---|
channelID | id of the channel | String |
filter? | filter calendar events | Object |
filter.before? | Date-time string | String |
filter.after? | Date-time string | String |
filter.limit? | Limit the calendar event output | Number |
Returns: Promise<Array<CalendarEvent>>
Get a specific calendar event component
Properties | Description | Type |
---|---|---|
channelID | id of the channel containing the event | String |
eventID | id of the event | Number |
Returns: Promise<CalendarEvent>
Get a list of calendar event rsvp
Properties | Description | Type |
---|---|---|
channelID | id of the channel containing the event | String |
eventID | id of the event | Number |
Returns: Promise<Array<CalendarEventRSVP>>
Get a specific calendar event rsvp
Properties | Description | Type |
---|---|---|
channelID | id of the channel containing the event | String |
eventID | id of the event | Number |
memberID | id of the member | String |
Returns: Promise<CalendarEventRSVP>
Get a specific item from a list channel.
Properties | Description | Type |
---|---|---|
channelID | id of the channel containing the list item | String |
itemID | id of the item | String |
Returns: Promise<ListItem>
Get a list of ListItem from a list channel.
Properties | Description | Type |
---|---|---|
channelID | id of the channel containing the list items | String |
Returns: Promise<Array<ListItem>>
Get a guild webhook.
Properties | Description | Type |
---|---|---|
guildID | id of the guild | String |
webhookID | id of the webhook | String |
Returns: Promise<Webhook>
Get a list of webhook selected from a specific channel.
Properties | Description | Type |
---|---|---|
guildID | id of the guild | String |
channelID | id of the channel | String |
Returns: Promise<Array<Webhook>>
Get a list of channel messages, only basic data included.
Properties | Description | Type |
---|---|---|
channelID | id of the channel | String |
filter? | filter channel messages | String |
filter.before? | Date-time string | String |
filter.after? | Date-time string | String |
filter.limit? | Limit the channel mesage output | Number |
filter.includePrivate? | Include private messages or not. | Boolean |
Returns: Promise<Array<Object>>
{% hint style="warning" %} Non-REST Methods only returns an object/array, methods and cached information aren't provided.
Be aware that the returned object/array is having Guilded API types and not ours. {% endhint %}
{% hint style="info" %} Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information. {% endhint %}
Get a list of channel docs, only basic data included.
Properties | Description | Type |
---|---|---|
channelID | id of the channel containing docs | String |
filter? | filter channel docs | String |
filter.before? | Date-time string | String |
filter.limit? | Limit the channel doc output | Number |
Returns: Promise<Array<Object>>
{% hint style="warning" %} Non-REST Methods only returns an object/array, methods and cached information aren't provided.
Be aware that the returned object/array is having Guilded API types and not ours. {% endhint %}
{% hint style="info" %} Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information. {% endhint %}
Get a list of forum topic, only basic data included.
Properties | Description | Type |
---|---|---|
channelID | id of the forum channel containing topics | String |
filter? | filter forum topics | String |
filter.before? | Date-time string | String |
filter.limit? | Limit the forum topic output | Number |
Returns: Promise<Array<Object>>
{% hint style="warning" %} Non-REST Methods only returns an object/array, methods and cached information aren't provided.
Be aware that the returned object/array is having Guilded API types and not ours. {% endhint %}
{% hint style="info" %} Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information. {% endhint %}
Array of object containing forum topic comments
Properties | Description | Type |
---|---|---|
channelID | id of the forum channel | String |
topicID | id of the forum topic | Number |
Returns: Promise<Array<Object>>
{% hint style="warning" %} Non-REST Methods only returns an object/array, methods and cached information aren't provided.
Be aware that the returned object/array is having Guilded API types and not ours. {% endhint %}
{% hint style="info" %} Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information. {% endhint %}
Get a list of calendar event, only basic data included.
Properties | Description | Type |
---|---|---|
channelID | id of the calendar channel containing events | String |
filter? | filter calendar events | String |
filter.before? | Date-time string | String |
filter.after? | Date-time string | String |
filter.limit? | Limit the calendar event output | Number |
Returns: Promise<Array<Object>>
{% hint style="warning" %} Non-REST Methods only returns an object/array, methods and cached information aren't provided.
Be aware that the returned object/array is having Guilded API types and not ours. {% endhint %}
{% hint style="info" %} Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information. {% endhint %}
Get a list of calendar event rsvp, only basic data included.
Properties | Description | Type |
---|---|---|
channelID | id of the calendar channel containing events | String |
eventID | id of the calendar event | Number |
Returns: Promise<Array<Object>>
{% hint style="warning" %} Non-REST Methods only returns an object/array, methods and cached information aren't provided.
Be aware that the returned object/array is having Guilded API types and not ours. {% endhint %}
{% hint style="info" %} Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information. {% endhint %}
List of item of the selected list channel, only basic data included.
Properties | Description | Type |
---|---|---|
channelID | id of the list channel which contains the items. | String |
Returns: Promise<Array<Object>>
{% hint style="warning" %} Non-REST Methods only returns an object/array, methods and cached information aren't provided.
Be aware that the returned object/array is having Guilded API types and not ours. {% endhint %}
{% hint style="info" %} Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information. {% endhint %}
Gives you a list of every roles the member has.
Properties | Description | Type |
---|---|---|
guildID | id of the server/guild | String |
memberID | id of the target member | String |
{% hint style="success" %} getMemberRoles is the only proposed method to get member's roles, it is because there is nothing to treat, it's just an array of 'roles' which are numbers/int. {% endhint %}
Returns: Promise<Array<Number>>
Returns you a list of channel webhooks, only basic data included.
Properties | Description | Type |
---|---|---|
guildID | id of the server/guild | String |
channelID | id of the channel | String |
Returns: Promise<Array<Object>>
{% hint style="warning" %} Non-REST Methods only returns an object/array, methods and cached information aren't provided.
Be aware that the returned object/array is having Guilded API types and not ours. {% endhint %}
{% hint style="info" %} Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information. {% endhint %}
Create a channel in a guild, can also be placed in a group or category.
Properties | Description | Type | Required? |
---|---|---|---|
guildID | id of the guild/server | Object | true |
name | new channel's name | String | true |
type | new channel's type ("announcement", "chat", "calendar", "forums", "media", "docs", "voice", "list", "scheduling", "stream") | String | true |
options | new channel's options | Object | false |
options.topic | new channel's topic/description. | String | false |
options.isPublic | -- | Boolean | false |
options.categoryID | locate the channel in a specific category | Number | false |
options.groupID | locate the channel in a specific group | String | false |
Returns: Promise<Channel>
Create a message in a specific channel.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | channel's id | String | true |
options | message's options | Object | true |
options.content | message content | String | false |
options.embeds | message's embeds | Array<Object> | false |
options.replyMessageIds | list of message id to reply | Array<String> | false |
options.isSilent | notify user(s)? | Boolean | false |
options.isPrivate | message will only be seen by those mentioned or replied to | Boolean | false |
Returns: Promise<Message>
Update a specific message.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | channel's id | String | true |
messageID | target message id | String | true |
newMessage | new message's options | Object | true |
newMessage.content | new message content | String | false |
newMessage.embeds | new message's embeds | Array<Object> | false |
Returns: Promise<Message>
Delete a specific message.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | channel's id | String | true |
messageID | target message id | String | true |
Returns: Promise<void>
Add a reaction to a channel message
Properties | Description | Type | Required? |
---|---|---|---|
channelID | channel id | String | true |
messageID | target message id | String | true |
reaction | emote id | Number | true |
Returns: Promise<void>
Remove a specific reaction from a channel message.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | channel id | String | true |
messageID | target message id | String | true |
reaction | emote id | Number | true |
Returns: Promise<void>
Create a topic in a forum.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | forum channel id | String | true |
options | topic options | Object | true |
options.title | topic title | String | true |
options.content | topic content | String | true |
Returns: Promise<ForumTopic>
Edit a specific forum topic
Properties | Description | Type | Required? |
---|---|---|---|
channelID | forum channel id | String | true |
topicID | forum topic id | Number | true |
options | topic options | Object | true |
options.title? | topic title | String | false |
options.content? | topic content | String | false |
Returns: Promise<ForumTopic>
Delete a specific forum topic
Properties | Description | Type | Required? |
---|---|---|---|
channelID | forum channel id | String | true |
topicID | forum topic id | Number | true |
Returns: Promise<void>
Pin a specific forum topic.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | forum channel id | String | true |
topicID | forum topic id | Number | true |
Returns: Promise<void>
Unpin a specific forum topic.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | forum channel id | String | true |
topicID | forum topic id | Number | true |
Returns: Promise<void>
Lock a specific forum topic.
Properties | Description | Type |
---|---|---|
channelID | id of the forum channel | String |
topicID | id of the forum topic | Number |
Returns: Promise<void>
Unlock a specific forum topic.
Properties | Description | Type |
---|---|---|
channelID | id of the forum channel | String |
topicID | id of the forum topic | Number |
Returns: Promise<void>
Add a reaction to a specified forum topic
Properties | Description | Type |
---|---|---|
channelID | id of the forum channel | String |
topicID | id of the forum topic | Number |
emote | id of an emote | Object |
Returns: Promise<void>
Remove a specific reaction from a forum topic.
Properties | Description | Type |
---|---|---|
channelID | id of the forum channel | String |
topicID | id of the forum topic | Number |
emote | id of an emote | Object |
Returns: Promise<void>
Add a comment to a specific forum topic.
Properties | Description | Type |
---|---|---|
channelID | id of the forum channel | String |
topicID | id of the forum topic | Number |
options | create options | Object |
options.content | content of the comment | String |
Returns: Promise<ForumTopicComment>
Edit a specific forum topic's comment.
Properties | Description | Type |
---|---|---|
channelID | id of the channel | String |
topicID | id of the forum topic | Number |
commentID | id of the topic comment | Number |
options? | edit options | Object |
options?.content? | new content of the comment | String |
Returns: Promise<ForumTopicComment>
Delete a specific forum topic's comment.
Properties | Description | Type |
---|---|---|
channelID | id of the channel | String |
topicID | id of the forum topic | Number |
commentID | id of the topic comment | Number |
Returns: Promise<void>
Create a doc in a docs channel.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | doc channel id | String | true |
options | doc options | Object | true |
options.title | doc title | String | true |
options.content | doc content | String | true |
Returns: Promise<Doc>
Edit a specific doc.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | doc channel id | String | true |
docID | channel doc id | Number | true |
options | doc options | Object | true |
options.title? | doc title | String | false |
options.content? | doc content | String | false |
Returns: Promise<Doc>
Delete a specific channel doc.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | doc channel id | String | true |
docID | channel doc id | Number | true |
Returns: Promise<void>
Create a calendar event.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | calendar channel id | String | true |
options | calendar event options | Object | true |
options.name | event name | String | true |
options.description? | event description | String | false |
options.location? | event location, can be anything | String | false |
options.startsAt? | Date-time string | String | false |
options.url? | event url | String | false |
options.color? | event color | Number | false |
options.rsvpLimit? | event entry limit | Number | false |
options.duration? | event duration in ms | Number | false |
options.isPrivate? | -- | Boolean | false |
Returns: Promise<CalendarEvent>
Edit a specific calendar event.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | calendar channel id | String | true |
eventID | calendar event id | Number | true |
options | calendar event options | Object | true |
options.name? | event name | String | false |
options.description? | event description | String | false |
options.location? | event location, can be anything | String | false |
options.startsAt? | Date-time string | String | false |
options.url? | event url | String | false |
options.color? | event color | Number | false |
options.rsvpLimit? | event entry limit | Number | false |
options.duration? | event duration in ms | Number | false |
options.isPrivate? | -- | Boolean | false |
Returns: Promise<CalendarEvent>
Delete a specific calendar event.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | calendar channel id | String | true |
eventID | calendar event id | Number | true |
Returns: Promise<void>
Add/edit a specific calendar event RSVP.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | calendar channel id | String | true |
eventID | calendar event id | Number | true |
memberID | rsvp member id | String | true |
options | event rsvp options | Object | true |
options.status | RSVP status ('going' ,'maybe'|, 'declined', 'invited', 'waitlisted', 'not responded') | String | true |
Returns: Promise<CalendarEventRSVP>
Delete a specific calendar event RSVP.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | calendar channel id | String | true |
eventID | calendar event id | Number | true |
memberID | rsvp target member id | String | true |
Returns: Promise<void>
Create an item within a list channel.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | 'List' channel id. | String | true |
content | content/message of the list | String | true |
note? | Note object | Object | false |
note.content | add a note/edit note content | String | true |
Returns: Promise<ListItem>
Edit a list item.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | 'List' channel id. | String | true |
itemID | ID of the target item. | String | true |
content | content/message of the list | String | true |
note? | Note object | Object | false |
note.content | add a note/edit note content | String | true |
Returns: Promise<ListItem>
Complete (checkmark will show up) a specific item from a list channel.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | 'List' channel id. | String | true |
itemID | ID of the target item. | String | true |
Returns: Promise<void>
Uncomplete (checkmark will disappear) a specific item from a list channel.
Properties | Description | Type | Required? |
---|---|---|---|
channelID | 'List' channel id. | String | true |
itemID | ID of the target item. | String | true |
Returns: Promise<void>
Add a Guild Member to a Guild group.
Properties | Description | Type | Required? |
---|---|---|---|
groupID | Guild group id | String | true |
memberID | ID of the target member. | String | true |
Returns: Promise<void>
Remove a Guild Member from a Guild group.
Properties | Description | Type | Required? |
---|---|---|---|
groupID | Guild group id | String | true |
memberID | ID of the target member. | String | true |
Returns: Promise<void>
Add a role to a guild member.
Properties | Description | Type | Required? |
---|---|---|---|
groupID | Guild group id | String | true |
memberID | ID of the target member. | String | true |
roleID | Role to add | Number | true |
Returns: Promise<void>
Remove a role from a guild member.
Properties | Description | Type | Required? |
---|---|---|---|
groupID | Guild group id | String | true |
memberID | ID of the target member. | String | true |
roleID | Role to add | Number | true |
Returns: Promise<void>
Create a new guild channel webhook.
Properties | Description | Type | Required? |
---|---|---|---|
guildID | id of the guild/server | String | true |
channelID | id of the channel | String | true |
name | name of the new webhook | String | true |
Returns: Promise<Webhook>
Edit a guild webhook.
Properties | Description | Type | Required? |
---|---|---|---|
guildID | id of the guild/server | String | true |
webhookID | id of the webhook | String | true |
options | edit options | Object | true |
options.name | new webhook's name | String | true |
options.channelID? | new webhook's channel location | String | false |
Returns: Promise<Webhook>
Delete a guild webhok.
Properties | Description | Type | Required? |
---|---|---|---|
guildID | id of the guild/server | String | true |
webhookID | id of the target webhook | String | true |
Returns: Promise<void>
Awards a member using the built-in EXP system. (Returns the 'total' experience)
Properties | Description | Type |
---|---|---|
guildID | the guild/server id | String |
memberID | the guild member id | String |
xpAmount | the amount of xp you'd like to give the specified member. | Number |
Returns: Promise<Number>
Sets a member's xp using the built-in EXP system. (Returns the 'total' experience)
Properties | Description | Type |
---|---|---|
guildID | the guild/server id | String |
memberID | the guild member id | String |
xpAmount | the new amount of xp the member will have. | Number |
Returns: Promise<Number>
Awards all members having a role using the built-in EXP system.
Properties | Description | Type |
---|---|---|
guildID | the guild/server id | String |
roleID | the role id | Number |
xpAmount | the amount of xp you'd like to give to everybody having the specified role. | Number |
Returns: Promise<void>