Skip to content

Commit 0775284

Browse files
discord-sdk: add inline reply support
1 parent eebaee9 commit 0775284

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

Diff for: runtime-discord/pylon-runtime-discord.d.ts

+43-2
Original file line numberDiff line numberDiff line change
@@ -3511,6 +3511,10 @@ declare module discord {
35113511
* A special message that appears in a channel when it begins following an announcements channel.
35123512
*/
35133513
CHANNEL_FOLLOW_ADD = 12,
3514+
/**
3515+
* A default message that includes a reference to a message.
3516+
*/
3517+
REPLY = 19,
35143518
}
35153519

35163520
/**
@@ -3727,6 +3731,16 @@ declare module discord {
37273731
* If set, will attempt to upload entries as file attachments to the message.
37283732
*/
37293733
attachments?: Array<IOutgoingMessageAttachment>;
3734+
/**
3735+
* When this is set, the message will attempt to become an inline reply of the provided message reference.
3736+
*
3737+
* The message or snowflake set here must reference a message inside the channel being sent to, otherwise an error will be thrown.
3738+
*
3739+
* You can configure wether the author of the message referenced here gets pinged by setting allowedMentions with repliedMessage set to false.
3740+
*
3741+
* Setting this on a [[discord.Message.inlineReply]] call overrides it. Conversely, setting it to `null` suppresses it.
3742+
*/
3743+
reply?: Message | Snowflake | Message.IMessageReference;
37303744
}
37313745

37323746
/**
@@ -3762,6 +3776,12 @@ declare module discord {
37623776
* You may pass an array of user ids or user/guildMember objects to whitelist a set of users you'd like to restrict notifications to.
37633777
*/
37643778
users?: true | Array<Snowflake | User | GuildMember>;
3779+
/**
3780+
* If set to true, this message will be allowed to ping the author of the referenced message for inline replies.
3781+
*
3782+
* If this isn't set, this is inferred to be true.
3783+
*/
3784+
reply?: boolean;
37653785
}
37663786

37673787
/**
@@ -3922,7 +3942,6 @@ declare module discord {
39223942
reply(
39233943
outgoingMessageOptions: Message.OutgoingMessageArgument<Message.OutgoingMessageOptions>
39243944
): Promise<Message>;
3925-
39263945
/**
39273946
* Attempts to send a simple text message to the channel this message was sent in.
39283947
*
@@ -3933,7 +3952,6 @@ declare module discord {
39333952
* @param content Content to use for the outgoing message.
39343953
*/
39353954
reply(content: Message.OutgoingMessageArgument<string>): Promise<Message>;
3936-
39373955
/**
39383956
* Attempts to send an [[discord.Embed]] to the channel this message was sent in.
39393957
*
@@ -3943,6 +3961,29 @@ declare module discord {
39433961
*/
39443962
reply(embed: Message.OutgoingMessageArgument<Embed>): Promise<Message>;
39453963

3964+
/**
3965+
* Does the same thing as .reply, but adds an inline reply referencing this message.
3966+
*
3967+
* If reply is set on the settings resolved by outgoingMessageOptions, then that will override the inline reply set by this function.
3968+
*
3969+
* @param outgoingMessageOptions Outgoing message options.
3970+
*/
3971+
inlineReply(
3972+
outgoingMessageOptions: Message.OutgoingMessageArgument<Message.OutgoingMessageOptions>
3973+
): Promise<Message>;
3974+
/**
3975+
* Does the same thing as .reply, but adds an inline reply referencing this message.
3976+
*
3977+
* @param content Content to use for the outgoing message.
3978+
*/
3979+
inlineReply(content: Message.OutgoingMessageArgument<string>): Promise<Message>;
3980+
/**
3981+
* Does the same thing as .reply, but adds an inline reply referencing this message.
3982+
*
3983+
* @param embed The embed object you'd like to send to the channel.
3984+
*/
3985+
inlineReply(embed: Message.OutgoingMessageArgument<Embed>): Promise<Message>;
3986+
39463987
/**
39473988
* Attempts to permanently delete this message.
39483989
*

Diff for: runtime/pylon-runtime.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ declare module pylon {
218218
[property: string]: Json;
219219
}
220220

221-
interface JsonArray extends Array<Json> {}
221+
interface JsonArray extends Array<Json> { }
222222

223223
type Json = string | number | boolean | null | JsonObject | JsonArray;
224224

0 commit comments

Comments
 (0)