Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working around message contents which is now a privileged intent #292

Closed
utarwyn opened this issue Jul 27, 2022 · 6 comments
Closed

Working around message contents which is now a privileged intent #292

utarwyn opened this issue Jul 27, 2022 · 6 comments
Assignees
Labels
bug: confirmed Confirmed bugs in discord-tictactoe.
Milestone

Comments

@utarwyn
Copy link
Owner

utarwyn commented Jul 27, 2022

While trying to test the discord.js v14 support added by PR #276, I noticed that the ?tttdeploy and ?tttdelete text commands were not working anymore. I learned that this is a limitation at the initiative of Discord.

Discord article: https://support-dev.discord.com/hc/en-us/articles/4404772028055
Quoting: "on August 31, 2022, access to message content will become a Privileged Intent".

Also:
The textual command to start a game is also affected by this limitation. Soon you will not be able to start a game using it. In order to fix that, I will work on new releases of versions 2 and 3 before this date. These versions will require you to add the privileged intent MESSAGE CONTENT to your bot to use the text command.

And for the future?
I understand the policy of Discord and I follow their principes. Messages should no longer be used to start a game, commands are the norm. Version 2 of the module will be deprecated as of August 31, 2022, and no more feature will be added on text commands as of this date on versions 3+ of the module.


Module version: 3.0.0
Discord.js version: 14.0.3

@utarwyn utarwyn added bug: confirmed Confirmed bugs in discord-tictactoe. status: help wanted Issues that need further investigation. labels Jul 27, 2022
@utarwyn utarwyn self-assigned this Jul 27, 2022
@utarwyn utarwyn pinned this issue Jul 27, 2022
@utarwyn
Copy link
Owner Author

utarwyn commented Jul 27, 2022

Do you have any idea on how to register slash commands without using messages? I do not want to force the usage of the privileged intent, only for admin commands. Thank you!

@Gorniaky
Copy link
Contributor

Gorniaky commented Jul 27, 2022

According to the rules of discord's new intent, when mentioning the bot or botrole of it, the content of the message is loaded, even if it's without the intent, I've been using this in mine as an alternative for a while, so try to use it too.

Take a look at the code below which is from my bot.
https://github.com/Raccoons-Code/Konan/blob/main/src/events/MessageCreate.ts#L20

@utarwyn
Copy link
Owner Author

utarwyn commented Jul 27, 2022

Super interesting idea! Thank you, I will work on this 👍
(this is explained in the Discord article.. I didn't read enough seriously...)

@utarwyn utarwyn removed the status: help wanted Issues that need further investigation. label Jul 27, 2022
@utarwyn
Copy link
Owner Author

utarwyn commented Jul 27, 2022

Versions 2 and 3 of the module are using Discord API v6 and v9, so I do not have specific action to do in the module source code.
More info on the Discord documentation: https://discord.com/developers/docs/topics/gateway#gateway-intents

But I will update the wiki to explicit the need of the privilged intent MESSAGE_CONTENT and discourage using text commands.

@utarwyn
Copy link
Owner Author

utarwyn commented Jul 27, 2022

Starting from v4 of the module, an error will be thrown with an explicit message when you configure a text command without the privileged intent enabled:

Error: You must enable Message Content intent to use the text command.
    at TicTacToe.<anonymous> (<anonymous>\discord-tictactoe\dist\src\index.js:48:27)
    at Generator.throw (<anonymous>)
    at rejected (<anonymous>\discord-tictactoe\dist\src\index.js:6:65)

@utarwyn utarwyn added this to the 4.x milestone Aug 30, 2022
@utarwyn
Copy link
Owner Author

utarwyn commented Sep 7, 2022

Version 4.0.0 of the module is now out with the support of discord.js v14 👍
More info on the release here: https://github.com/utarwyn/discord-tictactoe/releases/tag/v4.0.0

@utarwyn utarwyn closed this as completed Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: confirmed Confirmed bugs in discord-tictactoe.
Projects
None yet
Development

No branches or pull requests

2 participants