aoijs / aoi.js

aoi.js - The most advanced string-based package to create a Discord Bot fast and powerful.
https://aoi.js.org
Apache License 2.0
339 stars 135 forks source link

Bug: $suppressErrors #560

Closed celestialpluse closed 7 months ago

celestialpluse commented 7 months ago

Bug Type

Function

Bugged Function

module.exports = [{
    name: "moderate",
    type: "interaction",
    prototype: "slash",
    code: `
    $setMessageVar[TempuserID;$get[userid];$interactionData[message.id]]
    $setMessageVar[TempReason;$if[$slashOption[reason]==;No reason provided;$slashOption[reason]];$interactionData[message.id]]
    $setMessageVar[TempPunishment;$slashOption[action];$interactionData[message.id]]

    $interactionReply[{newEmbed:
    {title:<\:fileStorage\:1218850511382511726> __\` $getObjectProperty[data;username] \`'s Moderation Log Preview__}
    {field:**User ID**:\`$get[userid]\`:true}
    {field:**Display Name**:$getObjectProperty[data;displayName]:true}
    {field:**Account Age**:<t#COLON#$truncate[$divide[$getObjectProperty[data;joinDate];1000]]#COLON#R>:true}
    {field:**Reason**: $if[$slashOption[reason]==;No reason provided;$slashOption[reason]]}
    {field:**Punishment Type**: $slashOption[action]}
    {thumbnail:$getplayeravatar[$get[userid];420x420;Png;true;bust]}
    {color:#2d2d31}}
    {actionRow:{button:Confirm:success:confirm_$authorID:false:<#COLON#white_check#COLON#1176843997076017152>}
    {button:Decline:danger:deny_$authorID:false:<#COLON#white_cross#COLON#1176844776524492841>}};everyone;false;false]

$createObject[data;$getplayerinfo[$get[userid]]
$let[userid;$getidfromusername[$slashOption[username]]]
$suppressErrors[{newEmbed: 
    {title:**Username Error**}
    {description:The username you entered is invalid. Please double-check the spelling of the username.}
    {footer:Swift • Userinfo Command}
    {color:#2d2d31}}]
    `
}]

Version of aoi.js

v6.6.1

Version of Node.js

v20.10.0 (LTS)

Excepted Output

It sends the suppress error message If the username is correct and there is no error in the code image

Relevant log output

No response

Code of Conduct

Faf4a commented 7 months ago

Not a bug, happens if any error appears in the command, remove suppressErrors to see the full errors and reply back with it, thanks.

celestialpluse commented 7 months ago

Not a bug, happens if any error appears in the command, remove suppressErrors to see the full errors and reply back with it, thanks.

No errors in the console same command I tried in 6.7.1 standard version it works The image shown is in github version

Faf4a commented 7 months ago

You could try using the functionError event to debug this, please try so and get back with the result.

Faf4a commented 7 months ago

Closing due to inactivity.