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
329 stars 130 forks source link

Bug: Data Assigned to Parameters Does Not Work Correctly #606

Closed valentineu0 closed 2 months ago

valentineu0 commented 2 months ago

Bug Type

Function

Bugged Function

client.functionManager.createFunction(
    {
        name: "$banLog",
        params: ["v1", "v2", "v3"],
        $if: "old",
        type: "aoi.js",
        code: `
        $if[$channelType[$getGuildVar[ban-log]]==text&&$channelExists[$getGuildVar[ban-log]]==true]
            $channelSendMessage[$getGuildVar[ban-log];
                {author:Case #$getGuildVar[incident-case] — $username[{v2}]:$userAvatar[{v2}]}
                {field:Yetkili:<@{v1}> **$username[{v1}]}
                {field:Yasaklanan:<@{v2}> **$username[{v2}]}
                {field:Sebep:{v3}}
                {timestamp:}
                {color:$getGuildVar[ui-color]}
            ;false]
        $else
            $interactionReply[<:valentine_close:1188188914276630579> Eksik veya yanlış yapılandırma tespit edildi, lütfen </config ban:> ayarına girdiğiniz verinin doğruluğunu kontrol edin. Teknik bir sorun olduğunu düşünüyorsanız lütfen </fix:> komutunu kullanın.;everyone;true;false]
        $endif
        `
    }
);

Version of aoi.js

v6.7.1

Version of Node.js

v20.13.1

Excepted Output

The data received by my second parameter, which I assigned as v2, works incorrectly.

Relevant log output

AoiError: Invalid User ID [{v2}] 
{ 
   Function : `$username`,
   Command : `$banLog`,
   Version : 6.7.1 
}

Code of Conduct

DodoGames7 commented 2 months ago

custom functions in aoi.js type are broken, this is also made clear in the documentation itself image

valentineu0 commented 2 months ago

custom functions in aoi.js type are broken, this is also made clear in the documentation itself image

I didn't see that part, but I just wanted it fixed. It's bad for a really useful feature to work incorrectly.

Faf4a commented 2 months ago

not planned to fix until 6.9