feat: report message
client.api.reporting.menu.message.get({ query: { variant: 4, }, });
This commit is contained in:
parent
007cb0ad1a
commit
088de871f7
@ -1201,6 +1201,34 @@ class Message extends Base {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Report Message
|
||||
* @param {Arrray<number>} breadcrumbs Options for reporting
|
||||
* @param {Object} [elements={}] Metadata
|
||||
* @returns {Promise<{ report_id: Snowflake }>}
|
||||
* @example
|
||||
* // Report Category
|
||||
* // - <hidden>MESSAGE_WELCOME (3)</hidden>
|
||||
* // - Something else (28)
|
||||
* // - Hacks, cheats, phishing or malicious links (72)
|
||||
* message.report([3, 28, 72]).then(console.log);
|
||||
* // { "report_id": "1199663489988440124" }
|
||||
*/
|
||||
report(breadcrumbs, elements = {}) {
|
||||
return this.client.api.reporting.message.post({
|
||||
data: {
|
||||
version: '1.0',
|
||||
variant: '4',
|
||||
language: 'en',
|
||||
breadcrumbs,
|
||||
elements,
|
||||
channel_id: this.channelId,
|
||||
message_id: this.id,
|
||||
name: 'message',
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
exports.Message = Message;
|
||||
|
5
typings/index.d.ts
vendored
5
typings/index.d.ts
vendored
@ -1895,6 +1895,7 @@ export class Message<Cached extends boolean = boolean> extends Base {
|
||||
): Promise<Message | Modal>;
|
||||
public markUnread(): Promise<void>;
|
||||
public markRead(): Promise<void>;
|
||||
public report(breadcrumbs: number[], elements?: object): Promise<{ report_id: Snowflake }>;
|
||||
}
|
||||
|
||||
export class CallState extends Base {
|
||||
@ -3805,9 +3806,7 @@ export interface CustomStatusOption {
|
||||
status?: PresenceStatusData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://luna.gitlab.io/discord-unofficial-docs/user_settings.html}
|
||||
*/
|
||||
// Source: https://luna.gitlab.io/discord-unofficial-docs/user_settings.html
|
||||
export interface RawUserSettingsData {
|
||||
afk_timeout?: number;
|
||||
allow_accessibility_detection?: boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user