#getApplicationInfo() returning extra data which isn't on the type specified

1 messages · Page 1 of 1 (latest)

fervent vortex
#

Heyo,

Is there any reason why getApplicationInfo() returns data which is not in the listed in the CamelizedDiscordApplication type? I'm assuming its just an oversight?

Some of the properties missing are below, but there are also more. I did try to take a look into discordeno code and find where CamelizedDiscordApplication was defined, but I couldn't find where it actually sets the properties, it only where it imports.

bot (and all of its nested properties)
type
summary
hook
redirectUris
isMonetized
interactionsEndpointUrl
const f = await manager.getApplicationInfo();

I need some of this data for checking if my custom bot users have configured the settings correctly, for example the redirect URIs.

Also, is there any preprocessing done on the flags property? I'm attempting to try and check what intents the bot has but my checks for that do not seem to work, and after verifying with other people everything looks in the order, the only difference is I'm using discordeno/rest, so im guessing there is something a little bit different i need to do?

      const messageContent= 1 << 18;

      console.log(applicationInfo.flags); // 8953856
      if ((applicationInfo.flags & messageContent) === messageContent) {
        console.log('User has message content intent'); // this log never runs, no matter if the bot has the intents or not.
      }
sweet oyster
fervent vortex
#

Gives more data (the stuff i listed is in the returned object but does not reflect in the mentioned type)

sweet oyster
#

Probably an oversight I assume hmm

#

You're saying bot doesn't exist in the type? @fervent vortex

#

It exists in DiscordApplication and CamelizedDiscordApplication is basically Camelize<DiscordApplication> so it should list it I guess

light snow
fervent vortex
sweet oyster
#

Can you show type of f

light snow
sweet oyster
#

Yea bot's in docs

#
  • in dd
fervent vortex
#

and redirect etc...

the type of f is CamelizedDiscordApplication

light snow
#

then check the versions with the commits

sweet oyster
sweet oyster
#

can you check if you're in latest versions

light snow
sweet oyster
#

Isn't main the latest version? hmm

light snow
sweet oyster
#

i see

#

im not much knowledgeable on this then peaceout

fervent vortex
#

yea it sends me to the correct place, in camel.d.ts

light snow
#

@fervent vortex what version are you running?

fervent vortex
#
    "@discordeno/rest": "19.0.0-next.1545f01",
    "@discordeno/types": "v19.0.0-next.1545f01",
#

leme update rq and get back to u

light snow
#

that is before the commits for the api docs catchup so there are like 30 issues of api docs missing

#

(i think)

#

yep that commit is before the 2 pr for the api docs catchup

fervent vortex
#

thanks update fixed it, sorry for wasting your time. I should have checked my version before I made this thread neutral_pain

light snow
#

could have been some of those commit after d81(whatever are the other letters)

fervent vortex
#

thank you very much 🙂

Also, another problem i am having:

      const applicationInfo = await manager.getApplicationInfo();

      const messageContent = 1 << 18;

      console.log(applicationInfo.flags); // 8953856
      if ((applicationInfo.flags & messageContent) === messageContent) {
        console.log('User has message content intent');
      }

the console log for checking if the user has the required intent never seems to be output, is there any preprocessing done on applicationInfo.flags? I've checked this solution with other people and it is the same, only difference is im using discordeno/rest. Not sure if there is something else I need to be doing instead?

light snow
#

they in fact don't match (based on the number of your console log that you put as comment)

#

ignore that i used 3 for the pad, i almost never use padStart so needed to check it was working

#

checked with one of my bots that has the GATEWAY_MESSAGE_CONTENT (as discord calls it) intent

#

looks like the flag is NOT enabled if the bot is not verified, so it might be that

sweet oyster
#

uhh

#

what are you doing

#

(applicationInfo.flags & messageContent) === messageContent is right

#

if messageContent bit is in applicationInfo.flags, it'll return messageContent bit, otherwise 0

#

bitwise operators helps a lot btw, you should definitely learn, theyre very easy ^^

light snow
sweet oyster
#

& flag for checking if it exists (0 if doesnt exist, flag if exist)
| flag for adding
& ~flag to remove it

these are the basics that people would need

sweet oyster
light snow
sweet oyster
sweet oyster
#

like in languages like c, 1 boolean would be 1 byte, which would be 8 bits but if you store them as bitwise flags, you can have 8 bits instead, which acts like 8 booleans (does that make sense? lol)

light snow
sweet oyster
#

Yea, 1 bit can be 0 or 1, which can act like a boolean so instead of having 8 booleans (taking 64 bits), you can have 8 bits

#

And the operations aren't hard to understand, they're basic and, or. It'll help you understand them easily if you see them in binary

#

0000
0010 (or)

0010

#

This is why you say | is for adding bit

light snow
sweet oyster
#

They're easy once you see them in binary lol

sweet oyster
light snow
sweet oyster
#

I'll explain more in #general when I'm back but in reality they're pretty easy to remember and work with

#

They just look hard lol

#

Once you understand it's easy

fervent vortex
#

have verified the application id is correct, so im definetly checking the correct one.

sweet oyster
sweet oyster
fervent vortex
#

As far as I'm aware it should be containing this flag as I do have the message content intent enabled on this application. I've verified the app id is correct from the returned data of the call to getApplicationInfo()

sweet oyster
#

8953856 doesn't have 1<<18 is all I know, idk if 8953856 is the actual value nor if 1<<18 is the one for message content

sweet oyster
#

1<<18 is wrong

#

I check for direct value of 557056‎ and it doesn't have 1<<18

#

Also you're checking with gateway I guess

#

Lol

#

Nvm the link you sent isn't for gateway hmm

#

Oh right

#

1<<19 it is I guess

#

Yea 1<<19

#

Idk how exactly it differs but docs says 18 is for bots in above 100 servers and 19 is for bots in below

fervent vortex
#

ugh.. sorry man thank you for pointing that out bonk