Add deferred reply option to commands
This commit is contained in:
@@ -36,7 +36,7 @@ module.exports = {
|
|||||||
if (maxTokens) params._max_tokens = maxTokens;
|
if (maxTokens) params._max_tokens = maxTokens;
|
||||||
|
|
||||||
var gptResponse = await libCore.getChat(promptText, params);
|
var gptResponse = await libCore.getChat(promptText, params);
|
||||||
await interaction.reply(`${interaction.member.user} ${gptResponse}`);
|
await interaction.editReply(`${interaction.member.user} ${gptResponse}`);
|
||||||
|
|
||||||
// Needs reply code to reply to the generation
|
// Needs reply code to reply to the generation
|
||||||
}catch(err){
|
}catch(err){
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ module.exports = {
|
|||||||
await authorizeCommand(interaction, command, async () => {
|
await authorizeCommand(interaction, command, async () => {
|
||||||
await authorizeTokenUsage(interaction, command, async () => {
|
await authorizeTokenUsage(interaction, command, async () => {
|
||||||
try {
|
try {
|
||||||
|
if (command.deferInitialReply) await interaction.deferReply({ ephemeral: true });
|
||||||
command.execute(interaction);
|
command.execute(interaction);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.ERROR(error);
|
log.ERROR(error);
|
||||||
|
|||||||
Reference in New Issue
Block a user