Skip to content

Commit

Permalink
GH-192: use ephemeral messages for sending direct replies
Browse files Browse the repository at this point in the history
  • Loading branch information
utarwyn committed Aug 30, 2022
1 parent 81f2537 commit 767554f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/bot/messaging/CommandInteractionMessagingTunnel.ts
Expand Up @@ -55,7 +55,7 @@ export default class CommandInteractionMessagingTunnel extends MessagingTunnel {
/**
* @inheritdoc
*/
public async replyWith(answer: MessagingAnswer, _direct?: boolean): Promise<Message> {
public async replyWith(answer: MessagingAnswer, direct?: boolean): Promise<Message> {
// Fetch current reply if deferred externally and not register in this tunnel
if (!this.reply && this.interaction.deferred) {
this._reply = (await this.interaction.fetchReply()) as Message;
Expand All @@ -69,7 +69,8 @@ export default class CommandInteractionMessagingTunnel extends MessagingTunnel {

this._reply = (await this.interaction.reply({
...answer,
fetchReply: true
fetchReply: true,
ephemeral: direct
})) as Message;

return this._reply;
Expand Down
2 changes: 1 addition & 1 deletion src/bot/messaging/MessagingTunnel.ts
Expand Up @@ -37,7 +37,7 @@ export default abstract class MessagingTunnel {
* Replies something through the messaging tunnel.
*
* @param answer anwser to reply with
* @param direct true if the reply should be direct
* @param direct true if the reply should be direct and ephemeral
*/
public abstract replyWith(answer: MessagingAnswer, direct?: boolean): Promise<Message>;

Expand Down

0 comments on commit 767554f

Please sign in to comment.