unify typing logic for a more consistent experience

This commit is contained in:
bignutty 2024-12-08 15:00:18 +01:00
parent d2aeecf70d
commit 1ca74d3c2c
67 changed files with 240 additions and 109 deletions

View file

@ -30,7 +30,18 @@ module.exports.acknowledge = async function(context, incognito = false, permissi
return await context.respond({data: { flags: MessageFlags.EPHEMERAL }, type: InteractionCallbackTypes.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE});
}
return await context.respond({data: {}, type: InteractionCallbackTypes.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE})
}
};
// Command Flow
return await context.triggerTyping()
/**
* This endpoint will sometimes error when
* - Discord breaks their platform again
* - Discord disables it via cloudflare to reduce
* platform load.
*
* In order to avoid our bot from crashing, we catch the
* error here.
*/
return await context.triggerTyping().catch((e)=>{})
}