Fixed dropdown not supporting empty emojis
Fixed a bug that caused the bot to crash when spawning a dropdown panel which includes an option without emoji.
This commit is contained in:
@@ -17,14 +17,15 @@ const panelDropdowns = () => {
|
||||
new api.ODWorker("openticket:panel-dropdown-tickets",0,async (instance,params) => {
|
||||
const {panel,options} = params
|
||||
|
||||
|
||||
const parsedOptions: api.ODDropdownData["options"] = options.map((option) => {
|
||||
const desc = option.get("openticket:description").value.substring(0,100)
|
||||
const emoji = option.get("openticket:button-emoji").value
|
||||
return {
|
||||
label:option.get("openticket:button-label").value.substring(0,100),
|
||||
value:"od:ticket-option_"+panel.id.value+"_"+option.id.value,
|
||||
emoji:option.get("openticket:button-emoji").value,
|
||||
description:(desc.length > 0) ? desc : undefined
|
||||
emoji:(emoji.length > 0) ? emoji : undefined,
|
||||
description:(desc.length > 0) ? desc : undefined,
|
||||
default:false
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user