File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import {
22 EmbedBuilder ,
3+ MessageFlags ,
34 SlashCommandBuilder ,
45 SlashCommandStringOption ,
56} from "discord.js" ;
@@ -49,12 +50,11 @@ export const askCommand: Command = {
4950 // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
5051 const query = interaction . options . getString ( "query" ) ! ;
5152 const customOption = interaction . options . getString ( "custom" ) ;
52- const ephemeral = customOption === null ;
5353 const first = customOption === "FIRST" ;
5454 console . log ( `User ${ interaction . user } asked about "${ query } "` ) ;
5555
5656 try {
57- await interaction . deferReply ( { ephemeral } ) ;
57+ await interaction . deferReply ( { flags : customOption === null ? MessageFlags . Ephemeral : undefined } ) ;
5858 const data = await fetchBingus ( query ) ;
5959
6060 if ( data . length === 0 ) {
@@ -69,7 +69,7 @@ export const askCommand: Command = {
6969 . setTitle ( data [ 0 ] . title )
7070 . setDescription ( data [ 0 ] . text )
7171 . setColor ( "#65459A" )
72- . setFooter ( { text : `${ data [ 0 ] . relevance . toFixed ( ) } % relevant` } ) . data ,
72+ . setFooter ( { text : `${ data [ 0 ] . relevance . toFixed ( ) } % relevant` } ) . data ,
7373 ] ,
7474 } ) ;
7575
@@ -84,7 +84,7 @@ export const askCommand: Command = {
8484 . setTitle ( res . title )
8585 . setDescription ( res . text )
8686 . setColor ( "#65459A" )
87- . setFooter ( { text : `(${ res . relevance . toFixed ( ) } % relevant)` } ) . data ,
87+ . setFooter ( { text : `(${ res . relevance . toFixed ( ) } % relevant)` } ) . data ,
8888 ) ,
8989 ) ;
9090
Original file line number Diff line number Diff line change 22 ApplicationCommandType ,
33 ContextMenuCommandBuilder ,
44 EmbedBuilder ,
5+ MessageFlags ,
56} from "discord.js" ;
67import { ContextMenu } from "../index.js" ;
78import { fetchBingus } from "../util.js" ;
@@ -19,7 +20,7 @@ export const replyContext: ContextMenu = {
1920 ) ;
2021
2122 try {
22- await interaction . deferReply ( { ephemeral : true } ) ;
23+ await interaction . deferReply ( { flags : MessageFlags . Ephemeral } ) ;
2324 const data = await fetchBingus ( query ) ;
2425
2526 if ( data . length === 0 ) {
Original file line number Diff line number Diff line change 22 ApplicationCommandType ,
33 ContextMenuCommandBuilder ,
44 EmbedBuilder ,
5+ MessageFlags ,
56} from "discord.js" ;
67import { ContextMenu } from "../index.js" ;
78import { EmbedList , fetchBingus } from "../util.js" ;
@@ -19,7 +20,7 @@ export const replyListContext: ContextMenu = {
1920 ) ;
2021
2122 try {
22- await interaction . deferReply ( { ephemeral : true } ) ;
23+ await interaction . deferReply ( { flags : MessageFlags . Ephemeral } ) ;
2324
2425 if ( ! interaction . targetMessage . channel . isSendable ( ) ) {
2526 await interaction . editReply ( "Unable to send messages to this channel." ) ;
You can’t perform that action at this time.
0 commit comments