[V3 Core] More features for the bot invite URL #1847
No reviewers
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!1847
Loading…
Reference in a new issue
No description provided.
Delete branch "invite-additions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Description of the changes
This PR adds a new
[p]invitesetgroup command that allows 3 things:Make the
[p]invitecommand available for everyone, so they can invite the bot without asking its owner. However, if the "Public bot" option is not ticked in the token settings, the command will block the action and tell the user to modify it.Modify the permission level of the bot. The permission is given with the permission calculator (too complicated to use discord's method and iterate every permission) and it will be added to the bot's invite.
The ability to add a redirect URL. It will be added to the bot's invite too, and will redirect to a website when the bot is invited.
Warning
This PR is using a new feature that I made, which allows the bot to use the
bot_publicendpoint (to know if the "public bot" option is enabled or not). A PR is open on discord.py's repo, so please wait for it to be merged before merging this.The PR : https://github.com/Rapptz/discord.py/pull/1341
If you want to test that feature, do this in a virtualenv:
My pull request was just merged (actually rebased, but that's the same). This PR is not blocked anymore by discord.py.
This special casing for userbots should be removed. We dont support user bots, they are against discord's TOS.
Has conflict, please fix. Also, is the stuff in the rewrite branch of D.py yet?
@Kowlin yep, PR is rebased since august. I'll fix the conflicts.
I don't think this is appropriate to use embed specific formatting, as we specifically have a setting to disable embed use.
OAuth Redirects should not be user facing in the settings here in my opinion, as Red itself does nothing to support this, and this requires further settings properly configured on the developer panel to function.
Any developer who needs this, should have their code remove the core invite command and replace with their own. If this is beyond their capability, this setting is useless to them anyway.
This is something that can be useful for users and telling them to edit the bot is not a solution (especially with how hard it is to edit pip packages and keep them up-to-date).
I noticed that even when the bot is created for only one server, admins like when it creates his own role, as the other bots do, so they can directly customize permissions for each bot and drag them at the right place. (yes, that can be done with other roles, but they won't have the special status, making it assigned to the bot)
When I made this PR, the two main goals were making that command public and making it possible to edit the permissions integer, mostly what I had in mind. The
[p]invitesetcommand is made to customize the invite link with all Discord's features, and the permissions interger is the main feature of an invite link, it would be weird to remove that...I'm not saying to remove the permissions integer, but to remove the redirect. Without extra work, this will just appear to "break" the invite link for most end users. Even if you do go through half of that work, without handling the remaining portions, you get things like inviting the bot, followed by being sent to a link like:
https://www.google.com/search?q=how+do+I+use+discord?code=sdfgbhbgvcxcvgbgvfcdx&guild_id=42424242&permissions=0
(not a real code or ID)
Beyond this, nothing in red is enabled to use this, so it would have to be coded themselves.
And even beyond that, the point about pip packages is moot, you do not have to edit the pip package to edit commands included with the bot. We have paths to load from, and the ability to remove and replace commands.
I think this is asking for a headache telling users over and over that they need a site designed to use this just to say "hey, our command does everything an invite can", without considering if it should.
Revisiting this: If you add a warning when attempting to add a redirect that this may break the invite if used improperly, it would be sufficient for "well, you didn't listen to the warning"
@ -465,0 +484,4 @@"""if await self.bot.db.invite_public():await self.bot.db.invite_public.set(False)await ctx.send("The invite is now private.")This isn't a valid for use as a check. Will result in a
TypeErrorat runtime. (d.py only passes context, and there's no source ofselffor the instance method)You can write a check which uses
ctx.cog._can_get_invite_url, or refactor this to not be a check.@ -457,11 +465,65 @@ class Core(commands.Cog, CoreLogic):await ctx.send("No exception has occurred yet")Red doesn't have selfbot support, this condition should be removed.
@ -457,11 +465,65 @@ class Core(commands.Cog, CoreLogic):await ctx.send("No exception has occurred yet")Should the condition on line 268 also be removed? It was already there when I made the branch I think.
@ -457,11 +465,65 @@ class Core(commands.Cog, CoreLogic):await ctx.send("No exception has occurred yet")You should probably update your PR branch so you can more accurately view differences. That section isn't there on current code, and was removed prior to 3.0.0