Nevalicjus / invitebot

A discord.py bot that connects invites to roles, and adds then on members joining your server
https://invitebot.xyz
MIT License
15 stars 4 forks source link

[SUGGESTION] Possibility to handle Rules Screening #2

Closed vico93 closed 2 years ago

vico93 commented 2 years ago

Hi! First of all

I start recently to explore the Community mode on my Discord server, and i noticed this mode brings an interesting feature called Rules Screening, that is basically a "vanilla" rule accept UI before the member can start interacting at the server.

image

From what i learnt when i search on internet about this feature, very few bots support "handling" this UI (there is API calls to detect whenever the member actually accepted or skip the dialog at all), like for example using it instead of reaction roles to give "verified" roles for those who read the rules channel (i used Carl.gg for that). Different to reaction role, that seem like a jury-rig method, using the Rules Screening feature looks far more professional and less confusing to new members.

To date only one bot (as far i know) works with Rules Screening: this one i found on Reddit, at the time the author even made it open source but after a while he closed-sourced the bot, so its always a good thing to have an alternative to not be so dependent on a single way to achieve that (i'm not criticizing the other author for his choices, btw).

I noticed this bot already have a feature relative to roles, that is "link" an invite with a specific role, maybe adding an option to servers with Rules Screening enabled to only give the role if the member actually pass the dialog would be incredible useful, maybe also adding an option to auto-kick members who failed/take too long to accept the dialog would be interesting as well.

Here's where the API documentation goes over this feature. Also, this is a good post giving an example of how one can implement this feature.

Nevalicjus commented 2 years ago

I think this is a great suggestion!

And with such great research about the topic prior to making the suggestion it'll be a piece of cake šŸ˜„

I'll surely look into it šŸ˜„

vico93 commented 2 years ago

I think the only thing to consider is finding a way to detect whether or not the community mode is active on the server/guild. The dev of Gatekeeper (the bot i linked in OP) said something along the lines of "attempting to do a Rules Screening related check may cause problems on a server without Community mode enabled". I don't know if is something pertinent to his code of if Discord API can have some kind of problem when trying to use a Community mode method/function while the mode is OFF.

EDIT: Seems like is possible to determine if the server/guild has Community mode active. In fact, is possible to detect if the server has Rules Screening (called in docs "Membership Screening") specifically. (Link)

Nevalicjus commented 2 years ago

discord.py even provides an option to check it by viewing guild.features

Nevalicjus commented 2 years ago

With version v1.4, Invitebot is now able to await community rules acceptance prior to giving roles

vico93 commented 2 years ago

Great news to hear!