Pycord-Development / pycord

Pycord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python
https://docs.pycord.dev
MIT License
2.75k stars 462 forks source link

feat: ✨ New role tags #2606

Open Paillat-dev opened 1 month ago

Paillat-dev commented 1 month ago

Summary

fixes: #2474 cc @Lumabots

Information

Checklist

Lulalaby commented 1 month ago

Changelog

Paillat-dev commented 1 month ago

There. Maybe discord.RoleTags.is_integration() should be removed too ? That would be breaking tho.

plun1331 commented 1 month ago

is_integration is for roles managed by integrations, such as patreon/twitch is_bot_managed is for roles assigned to bots when added to a server by discord is_premium_subscriber is for the server booster role managed by discord managed is True if any of the above is True

In my testing, with this logic, is_integration works just fine and was never broken. This should really be a documentation update, as the docs are misleading.

Lulalaby commented 1 month ago

Do we cover the new tags also? Like for role subscription, server shop, etc

plun1331 commented 1 month ago

Do we cover the new tags also? Like for role subscription, server shop, etc

We do not, missing subscription_listing_id, available_for_purchase, guild_connections

Lulalaby commented 1 month ago

https://gist.github.com/Lulalaby/a9ac5fcce5c182efd55167e6141c1542 As little help

Paillat-dev commented 1 month ago

Yeah that was a documentation issue. I will change that instead.

Paillat-dev commented 1 month ago

@plun1331 I might add the other tags too now that i'm here.

plun1331 commented 1 month ago

Go for it, shouldn't be too difficult

Paillat-dev commented 1 month ago

Could test guild_connections but not the rest as I don't have the right setup.

Paillat-dev commented 1 month ago

By design, Role.is_integration() is true if RoleTags.integration_id is not None. This means it will be True for

  1. Twitch, YouTube, etc... integrations
  2. Guild subscriptions roles

https://gist.github.com/Lulalaby/a9ac5fcce5c182efd55167e6141c1542#premium-subscriber-tier

Paillat-dev commented 1 month ago

I changed the docstrings again to be clearer.

Paillat-dev commented 1 month ago

Done, Plun did it but then I did it with rebase so the history is clean

Lulalaby commented 1 month ago

Thank u. I'm gonna review it within the next two days. I'm still traveling through Europe rn 😂

Choo Choo I'm a train

Paillat-dev commented 1 month ago

Before merge someone might want to test the premium guild stuff and what I couldn't test

plun1331 commented 3 weeks ago

do you have to force push everything

Paillat-dev commented 3 weeks ago

I like keeping a clean history

plun1331 commented 3 weeks ago

I like keeping a clean history

makes it harder to see what you changed, and it all gets squashed anyways