mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-21 04:25:27 -04:00
Merge branch 'master' of https://github.com/revoltchat/revolt.js
This commit is contained in:
+10
-1
@@ -109,7 +109,7 @@ export class Message {
|
||||
* Edit a message
|
||||
* @param data Message edit route data
|
||||
*/
|
||||
async edit(data: Route<'PATCH', '/channels/id/messages/id'>["data"]) {
|
||||
async edit(data: Route<'PATCH', '/channels/id/messages/id'>["data"]) {
|
||||
return await this.client.req('PATCH', `/channels/${this.channel_id}/messages/${this._id}` as '/channels/id/messages/id', data);
|
||||
}
|
||||
|
||||
@@ -126,6 +126,15 @@ export class Message {
|
||||
ack() {
|
||||
this.channel?.ack(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reply to Message
|
||||
*/
|
||||
|
||||
reply(data: string | (Omit<Route<'POST', '/channels/id/messages'>["data"], 'nonce'> & { nonce?: string }), mention = true) {
|
||||
let obj = typeof data === 'string' ? { content: data } : data;
|
||||
return this.channel?.sendMessage({ ...obj, replies: [{ id: this._id, mention }] })
|
||||
}
|
||||
}
|
||||
|
||||
export default class Messages extends Collection<string, Message> {
|
||||
|
||||
Reference in New Issue
Block a user