CosmoQuestX / Rocket-Bot

The Bot of the New generation of explorers for the CosmoQuest server on Discord. Assembled with official APIs and documentation, originally created using the Github Students Program tools.
https://CosmoQuest.org/x/
2 stars 1 forks source link

cookie command needs to accommodate usernames without an at-sign #33

Closed KeeperOfMaps closed 1 year ago

KeeperOfMaps commented 2 years ago

The cookie command should be able to handle a username that does not start with an @-sign.

This should resolve the following errors:

2022-10-29T06:38:38.182091604Z     at Object.exports.run (/usr/src/app/commands/cookie.js:12:19)
2022-10-29T06:38:38.182097835Z     at Client.<anonymous> (/usr/src/app/main.js:135:21)
2022-10-29T06:38:38.182103034Z     at processTicksAndRejections (node:internal/process/task_queues:96:5)
KeeperOfMaps commented 2 years ago

Also, documentation for the command should reflect the need for an at-sign.

TheRealFakeAdmin commented 2 years ago

The cookie command should be able to handle a username that does not start with an @-sign.

Sadly, because of the lack of permissions [see GUILD_MEMBERS here], the bot only has access to the sending user and any mentioned per message. This means the bot cannot convert a text-name to a valid mention.

There is a chance that the bot can just do @username, having Discord convert it to a mention, though this needs further testing.


Also, documentation for the command should reflect the need for an at-sign.

Noted. I will add that along with the other fixes.


2022-10-29T06:38:38.182091604Z     at Object.exports.run (/usr/src/app/commands/cookie.js:12:19)
2022-10-29T06:38:38.182097835Z     at Client.<anonymous> (/usr/src/app/main.js:135:21)
2022-10-29T06:38:38.182103034Z     at processTicksAndRejections (node:internal/process/task_queues:96:5)

The error above should not occur either way; I will look into that.

TheRealFakeAdmin commented 1 year ago

This was fixed in a recent release. Cookie no longer returns a mention but the nickname, so any input (including mentions) will be returned.