Skip to content

rest

We have not yet implemented all the REST APIs.

First, please refer to this official docs.

There is a certain degree of relevance between the rest function call and each endpoint.

get-channel.ts
// GET: /channels/{channel.id}
const { result } = await rest('token').channels('channel.id').get()
create-message.ts
// POST: /channels/{channel.id}/messages
await rest('token').channels('channel.id').messages().post(messageData)
create-reaction.ts
// PUT: /channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me
await rest('token')
.channels('channel.id')
.messages('message.id')
.reactions('emoji')
.me()
.put()
// METHOD: /CATEGORY/{CATEGORY_ID}/SUB/{SUB_ID}
rest('token').CATEGORY('CATEGORY_ID').SUB('SUB_ID').METHOD('data or null')

List of REST API and corresponding methods

.channels().get()📑
^.delete()📑
^.messages().get()📑 📑
^^.post()📑
^^.patch()📑
^^.delete()📑
^^.crosspost().post()📑
^^.reactions().get()📑
^^^.delete()📑 📑
^^^.me().put()📑
^^^^.delete()📑
^^^.user().delete()📑