🤖Client
The Guilded Bot's client, where everything's happen and where the Guilded bot interacts with guilds/servers.
Properties
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
token
The bot's inserted token.
String
Constructor
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
Methods
Client have standard event emitter types, they're not listed there.
connect()
Connects your bot to the Guilded API.
getRESTChannel(channelID)
Get a specific channel's information.
channelID
id of the channel you'd like to get.
String
Returns: Promise<Channel>
getRESTMember(guildID, memberID)
Get a specific guild's/server's member.
guildID
id of the server
String
memberID
id of the user
String
Returns: Promise<Member>
getRESTGuild(guildID)
Get a specific guild/server.
guildID
id of the server
String
Returns: Promise<Guild>
getRESTChannelMessages(channelID, filter?)
Get a list channel Message component.
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>>
getRESTChannelDocs(channelID, filter?)
Get a list of channel Doc component.
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>>
getRESTChannelDoc(channelID, docID)
Get a specific channel doc.
channelID
id of the channel
String
docID
id of the doc
Number
Returns: Promise<Doc>
getRESTForumTopics(channelID, filter?)
Get a list of ForumTopic component.
channelID
id of the channel
String
filter?
filter forum topics
Object
filter.before?
Date-time string
String
filter.limit?
Limit the forum topic output
Number
Returns: Promise<Array<ForumTopic>>
getRESTForumTopic(channelID, topicID)
Get a specific ForumTopic component
channelID
id of the channel
String
topicID
id of the topic
Number
Returns: Promise<ForumTopic>
getRESTCalendarEvents(channelID, filter?)
Get a list of CalendarEvent component
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>>
getRESTCalendarEvent(channelID, eventID)
Get a specific calendar event component
channelID
id of the channel containing the event
String
eventID
id of the event
Number
Returns: Promise<CalendarEvent>
getRESTCalendarRsvps(channelID, eventID)
Get a list of calendar event rsvp
channelID
id of the channel containing the event
String
eventID
id of the event
Number
Returns: Promise<Array<CalendarEventRSVP>>
getRESTCalendarRsvp(channelID, eventID, memberID)
Get a specific calendar event rsvp
channelID
id of the channel containing the event
String
eventID
id of the event
Number
memberID
id of the member
String
Returns: Promise<CalendarEventRSVP>
getRESTListItem(channelID, itemID)
Get a specific item from a list channel.
channelID
id of the channel containing the list item
String
itemID
id of the item
String
Returns: Promise<ListItem>
getRESTListItems(channelID)
Get a list of ListItem from a list channel.
channelID
id of the channel containing the list items
String
Returns: Promise<Array<ListItem>>
getRESTGuildWebhook(guildID, webhookID)
Get a guild webhook.
guildID
id of the guild
String
webhookID
id of the webhook
String
Returns: Promise<Webhook>
getRESTChannelWebhooks(guildID, channelID)
Get a list of webhook selected from a specific channel.
guildID
id of the guild
String
channelID
id of the channel
String
Returns: Promise<Array<Webhook>>
getChannelMessages(channelID, filter?)
Get a list of channel messages, only basic data included.
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>>
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.
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
getChannelDocs(channelID, filter?)
Get a list of channel docs, only basic data included.
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>>
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.
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
getForumTopics(channelID, filter?)
Get a list of forum topic, only basic data included.
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>>
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.
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
getCalendarEvents(channelID, filter?)
Get a list of calendar event, only basic data included.
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>>
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.
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
getCalendarRsvps(channelID, eventID)
Get a list of calendar event rsvp, only basic data included.
channelID
id of the calendar channel containing events
String
eventID
id of the calendar event
Number
Returns: Promise<Array<Object>>
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.
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
getListItems(channelID)
List of item of the selected list channel, only basic data included.
channelID
id of the list channel which contains the items.
String
Returns: Promise<Array<Object>>
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.
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
getMemberRoles(guildID, memberID)
Gives you a list of every roles the member has.
guildID
id of the server/guild
String
memberID
id of the target member
String
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.
Returns: Promise<Array<Number>>
getChannelWebhooks(guildID, channelID)
Returns you a list of channel webhooks, only basic data included.
guildID
id of the server/guild
String
channelID
id of the channel
String
Returns: Promise<Array<Object>>
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.
Non-REST Methods can provide better response time than the REST ones when it treats multiple object of information.
createChannel(location, name, type, options)
Create a channel in a guild, can also be placed in a group or category.
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>
createMessage(channelID, options)
Create a message in a specific channel.
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>
editMessage(channelID, messageID, newMessage)
Update a specific message.
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>
deleteMessage(channelID, messageID)
Delete a specific message.
channelID
channel's id
String
true
messageID
target message id
String
true
Returns: Promise<void>
addMessageReaction(channelID, messageID, reaction)
Add a reaction to a channel message
channelID
channel id
String
true
messageID
target message id
String
true
reaction
emote id
Number
true
Returns: Promise<void>
removeMessageReaction(channelID, messageID, reaction)
Remove a specific reaction from a channel message.
channelID
channel id
String
true
messageID
target message id
String
true
reaction
emote id
Number
true
Returns: Promise<void>
createTopic(channelID, options)
Create a topic in a forum.
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>
editTopic(channelID, topicID)
Edit a specific forum topic
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>
deleteTopic(channelID, topicID)
Delete a specific forum topic
channelID
forum channel id
String
true
topicID
forum topic id
Number
true
Returns: Promise<void>
pinTopic(channelID, topicID)
Pin a specific forum topic.
channelID
forum channel id
String
true
topicID
forum topic id
Number
true
Returns: Promise<void>
unpinTopic(channelID, topicID)
Unpin a specific forum topic.
channelID
forum channel id
String
true
topicID
forum topic id
Number
true
Returns: Promise<void>
createDoc(channelID, options)
Create a doc in a docs channel.
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>
editDoc(channelID, docID, options)
Edit a specific doc.
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>
deleteDoc(channelID)
Delete a specific channel doc.
channelID
doc channel id
String
true
docID
channel doc id
Number
true
Returns: Promise<void>
createCalendarEvent(channelID, options)
Create a calendar event.
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>
editCalendarEvent(channelID, eventID, options)
Edit a specific calendar event.
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>
deleteCalendarEvent(channelID, eventID)
Delete a specific calendar event.
channelID
calendar channel id
String
true
eventID
calendar event id
Number
true
Returns: Promise<void>
editCalendarRsvp(channelID, eventID, memberID)
Add/edit a specific calendar event RSVP.
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>
deleteCalendarRsvp(channelID, eventID, memberID)
Delete a specific calendar event RSVP.
channelID
calendar channel id
String
true
eventID
calendar event id
Number
true
memberID
rsvp target member id
String
true
Returns: Promise<void>
createListItem(channelID, content, note?)
Create an item within a list channel.
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>
editListItem(channelID, itemID, content, note?)
Edit a list item.
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>
completeListItem(channelID, itemID)
Complete (checkmark will show up) a specific item from a list channel.
channelID
'List' channel id.
String
true
itemID
ID of the target item.
String
true
Returns: Promise<void>
uncompleteListItem(channelID, itemID)
Uncomplete (checkmark will disappear) a specific item from a list channel.
channelID
'List' channel id.
String
true
itemID
ID of the target item.
String
true
Returns: Promise<void>
addGuildMemberGroup(groupID, memberID)
Add a Guild Member to a Guild group.
groupID
Guild group id
String
true
memberID
ID of the target member.
String
true
Returns: Promise<void>
removeGuildMemberGroup(groupID, memberID)
Remove a Guild Member from a Guild group.
groupID
Guild group id
String
true
memberID
ID of the target member.
String
true
Returns: Promise<void>
addGuildMemberRole(guildID, memberID, roleID)
Add a role to a guild member.
groupID
Guild group id
String
true
memberID
ID of the target member.
String
true
roleID
Role to add
Number
true
Returns: Promise<void>
removeGuildMemberRole(guildID, memberID, roleID)
Remove a role from a guild member.
groupID
Guild group id
String
true
memberID
ID of the target member.
String
true
roleID
Role to add
Number
true
Returns: Promise<void>
createGuildWebhook(guildID, channelID, name)
Create a new guild channel webhook.
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>
editGuildWebhook(guildID, webhookID, options)
Edit a guild webhook.
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>
deleteGuildWebhook(guildID, webhookID)
Delete a guild webhok.
guildID
id of the guild/server
String
true
webhookID
id of the target webhook
String
true
Returns: Promise<void>
Last updated