Skip to content

Instantly share code, notes, and snippets.

@dnnsmnstrr
Created February 28, 2023 13:18
Show Gist options
  • Save dnnsmnstrr/f14de4044b3a4a189de686df92a7ad22 to your computer and use it in GitHub Desktop.
Save dnnsmnstrr/f14de4044b3a4a189de686df92a7ad22 to your computer and use it in GitHub Desktop.
Helper function to show HUD in BTT with JavaScript
function showHUD(text, icon, duration = 3) {
const hudConfig = {
BTTActionHUDHideWhenOtherHUDAppears: true,
BTTActionHUDDetail: text,
BTTIconConfigSFSymbolName: icon,
BTTActionHUDDuration: duration,
BTTActionHUDSlideDirection: 0,
BTTIconConfigImageHeight: 50,
BTTActionHUDTitle: "",
BTTIconConfigIconType: 2,
};
const actionDefinition = {
BTTWaitForReply: false,
BTTPredefinedActionType: 254,
BTTHUDActionConfiguration: JSON.stringify(hudConfig),
};
callBTT("trigger_action", { json: JSON.stringify(actionDefinition) });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment