MCPcopy Create free account
hub / github.com/Botloader/botloader / constructor

Method constructor

components/runtime/src/ts/discord/message.ts:52–82  ·  view source on GitHub ↗

* @internal

(json: IMessage)

Source from the content-addressed store, hash-verified

50 * @internal
51 */
52 constructor(json: IMessage) {
53 this.activity = json.activity;
54 this.application = json.application;
55 this.attachments = json.attachments;
56 this.author = new User(json.author);
57 this.channelId = json.channelId;
58 this.components = json.components;
59 this.content = json.content;
60 this.editedTimestamp = json.editedTimestamp;
61 this.embeds = json.embeds;
62 this.flags = json.flags;
63 this.guildId = json.guildId ?? getCurrentGuildId();
64 this.id = json.id;
65 this.interactionMetadata = json.interactionMetadata ? new InteractionMetadata(json.interactionMetadata) : null;
66 this.kind = json.kind;
67 this.member = json.member;
68 this.mentionChannels = json.mentionChannels;
69 this.mentionEveryone = json.mentionEveryone;
70 this.mentionRoles = json.mentionRoles;
71 this.mentions = json.mentions.map(v => new UserMention(v));
72 this.messageSnapshots = json.messageSnapshots.map(v => new MessageSnapshot(v));
73 this.pinned = json.pinned;
74 this.reactions = json.reactions;
75 this.reference = json.reference;
76 this.referencedMessage = json.referencedMessage ? new Message(json.referencedMessage) : null;
77 this.timestamp = json.timestamp;
78 this.tts = json.tts;
79 this.webhookId = json.webhookId;
80
81
82 }
83
84 hyperlink() {
85 return `https://discord.com/channels/${this.guildId}/${this.channelId}/${this.id}`

Callers

nothing calls this directly

Calls 1

getCurrentGuildIdFunction · 0.90

Tested by

no test coverage detected