mirror of
https://github.com/stoatchat/javascript-client-api.git
synced 2026-07-16 05:31:52 -04:00
feat: add masquerade to messages
This commit is contained in:
+642
-583
File diff suppressed because it is too large
Load Diff
@@ -169,6 +169,7 @@ resource('/channels/:channel/messages', {
|
||||
...channelParams,
|
||||
...await body("Message to be sent.", schema`
|
||||
import type { Id, AutumnId } from './_common';
|
||||
import type { Masquerade } from './Channels';
|
||||
|
||||
interface ${'SendMessage'} {
|
||||
/**
|
||||
@@ -197,6 +198,8 @@ resource('/channels/:channel/messages', {
|
||||
*/
|
||||
mention: boolean;
|
||||
}[]
|
||||
|
||||
masquerade?: Masquerade;
|
||||
}
|
||||
`),
|
||||
...await success(
|
||||
|
||||
@@ -148,6 +148,22 @@ export type VoiceChannel = ServerChannel & {
|
||||
|
||||
export type Channel = (SavedMessagesChannel | DirectMessageChannel | GroupChannel | TextChannel | VoiceChannel)
|
||||
|
||||
/**
|
||||
* Masquerade displayed for a message.
|
||||
* Replaces user's name and avatar.
|
||||
*/
|
||||
export type Masquerade = {
|
||||
/**
|
||||
* Nickname to display
|
||||
*/
|
||||
name: string
|
||||
|
||||
/**
|
||||
* Avatar URL
|
||||
*/
|
||||
avatar: string
|
||||
}
|
||||
|
||||
export type Message = {
|
||||
/**
|
||||
* Message Id
|
||||
@@ -195,6 +211,8 @@ export type Message = {
|
||||
* Array of message IDs replied to
|
||||
*/
|
||||
replies?: Id[]
|
||||
|
||||
masqurade?: Masquerade
|
||||
}
|
||||
|
||||
export type SystemMessage =
|
||||
|
||||
Reference in New Issue
Block a user