refactor: Rewrite the role tags mess#2708
Open
Paillat-dev wants to merge 41 commits intoPycord-Development:masterfrom
Open
refactor: Rewrite the role tags mess#2708Paillat-dev wants to merge 41 commits intoPycord-Development:masterfrom
Paillat-dev wants to merge 41 commits intoPycord-Development:masterfrom
Conversation
20d75bb to
696dcbf
Compare
plun1331
reviewed
Feb 6, 2025
Member
plun1331
left a comment
There was a problem hiding this comment.
This looks really easy to make backwards compatible, can we just do that and deprecate all the compatibility methods?
Member
Author
|
Yeah maybe i'll try, but it sucks when I reused method names to become properties |
Member
Author
|
What are your thoughts on adding something like an enum, e.g. |
Paillat-dev
commented
Feb 10, 2025
Member
|
As we previously talked on dcs, the role type enum is the best way. Like plun said, deprecated all current methods and just create the type on role. But the docs should clarify that it's calculated since it's not returned by discord |
0c18960 to
7e7d40e
Compare
7e7d40e to
5810fa3
Compare
27a15ee to
54f1baa
Compare
Member
Author
|
Here is a handy snippet for testing this: import logging
import os
from datetime import datetime, UTC
from dotenv import load_dotenv
import discord
load_dotenv()
logging.basicConfig(level=logging.DEBUG)
TOKEN = os.getenv("TOKEN_3")
bot = discord.Bot()
@bot.slash_command()
async def test_roles(ctx: discord.ApplicationContext, role: discord.Role):
await ctx.defer()
if not ctx.guild:
return await ctx.respond("This command must be used in a guild.")
fetched_role = await ctx.guild.fetch_role(role.id)
await ctx.respond(f"""```
Role:
{role!r}
Role tags:
{role.tags!r}
Role tags data:
{role.tags._data if role.tags else None}
Fetched role:
{fetched_role!r}
Fetched role tags:
{fetched_role.tags!r}
Fetched role tags data:
{fetched_role.tags._data if fetched_role.tags else None}
```""")
bot.run(TOKEN) |
Member
Author
|
Do not merge yet |
Co-authored-by: plun1331 <plun1331@gmail.com> Signed-off-by: Paillat <jeremiecotti@ik.me>
Co-authored-by: plun1331 <plun1331@gmail.com> Signed-off-by: Paillat <jeremiecotti@ik.me>
Co-authored-by: plun1331 <plun1331@gmail.com> Signed-off-by: Paillat <jeremiecotti@ik.me>
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: plun1331 <plun1331@gmail.com> Signed-off-by: Paillat <jeremiecotti@ik.me>
d030f17 to
c27c52d
Compare
3e162b1 to
cab1fe7
Compare
Member
Author
Soheab
reviewed
Feb 18, 2026
discord/role.py
Outdated
| If you find an issue, please report it on `GitHub <https://github.com/Pycord-Development/pycord/issues/new?template=bug_report.yml>`_. | ||
| Read `this <https://lulalaby.notion.site/special-roles-role-tags>`_ if you need detailed information about how role tags work. | ||
|
|
||
| .. versionadded:: 1.6 |
Paillat-dev
commented
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Rewrite the role tags mess.

Information
examples, ...).
Checklist
type: ignorecomments were used, a comment is also left explaining why.