-
-
Notifications
You must be signed in to change notification settings - Fork 482
add support for role icons #254
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
Conversation
|
Aren't role icons already in work in #224 🤔 |
It needs improvements but I was and currently too busy so you can close 224 and merge this. |
|
Also @zeffo, Also, add |
|
Yes, unicode_emoji is a data key on itself |
|
I didn't notice #224, my bad. Will make suggested changes, thank you both! |
224 is closed now. Continue here |
|
@nerdguyahmad do the docstrings look okay? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 🚀
|
isnt this exactly the same stuff which you did in your PR? |
I didn't do unicode emojis. |
|
:| was just a few lines, you didnt have to close |
I was too busy. besides, Swas pointed out that my PR was pointing to the feature/slash instead of master and I had to create a followup PR to fix that but I couldn't get time to do that. |
|
Pending check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing works x~x
|
that should fix it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now it's basically LGTM.
Add, Modify & Delete Icon/UnicodeEmoji is working.
However, I am afraid that we will have problems with deleting / removing the role icon when both was supplied.
We should probably set on a remove request both the icon and the unicode_emoji to None, to be sure that it'll get removed.
Implement a few logical checks.
Here is in example of DisCatSharp (C#)
Aiko-IT-Systems/DisCatSharp@459f12a
if (emoji.HasValue && !iconb64.HasValue)
pld.UnicodeEmoji = emoji;
if (emoji.HasValue && iconb64.HasValue)
{
pld.IconBase64 = null;
pld.UnicodeEmoji = emoji;
}
if (iconb64.HasValue)
pld.IconBase64 = iconb64;To be save look into our implementation commits: https://aitsys.dev/T31
Tested with https://aitsys.dev/F8400
I might have got you wrong but what about: if unicode_emoji is not MISSING and icon is not MISSING:
raise TypeError("unicode_emoji and icon keyword arguments cannot be mixed") |
True, well basically you can do it, but discord primary uses the icon then. |
|
From what I'm understanding, |
|
I believe there are two ways we can go about this, one is to set icon to None if unicode_emoji is not MISSING, and the other way would be to check if unicode_emoji is not MISSING and icon is not None or MISSING and if so, raise an error. Which one sounds better? |
|
I would prefer to automatically set the icon to None and note it in the docs as stated here: #254 (review) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
LGTM 👍 |
* Prefer static_format over format with static assets * GitHub Action to lint Python code * bytes, not Bytes * Update lint_python.yml * Delete lint_python.yml * Fix typos discovered by codespell * Fix typos discovered by codespell * GitHub Action to run codespell * Make id parameter positional only * Code Of conduct is a suggestion by Github * Change `ctx.send` to `ctx.respond` in the README (#197) * Update README.rst * Update README.rst * Added START_EMBEDDED_ACTIVITIES permission #198 (#199) * Use start_embedded_activities instead of create_instant_invite * Use an Enum for embedded activites * Fix error in docstring * Add typehinting to pull request checklist * fix: distribution * change: display text * fixup! Fix typo for overridden * Changed unchanged change * Add *items to View * Add Pycord Development to LICENSE * License updates * Fix accidental deletion in 1257776 * Add dependabot * Add CodeQL * Bump sphinx from 4.0.2 to 4.2.0 Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 4.0.2 to 4.2.0. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/4.x/CHANGES) - [Commits](sphinx-doc/sphinx@v4.0.2...v4.2.0) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Set pycord user-agent (#241) * created delete_after parameter for ctx.respond (#180) * created delete_after parameter for ctx.respond * Update discord/interactions.py Co-authored-by: proguy914629 <74696067+proguy914629bot@users.noreply.github.com> * added eventloop thing * fixed ensure_future Co-authored-by: proguy914629 <74696067+proguy914629bot@users.noreply.github.com> * Added `on_raw_typing` event (#63) * Added `on_raw_typing` event * Fixes and adjustments for on_raw_typing Co-authored-by: Swas.py <61446939+CodeWithSwastik@users.noreply.github.com> * add support for role icons (#254) * add support for role icons * add unicode_emoji attribute and change Role.edit * role.edit required b64 string for icon * passing None should remove the icon * change documentation to reflect changes * update docstring for Role * invalid sentence * remove unnecessary documentation * add new valid keys * add valid keys * set icon to None if unicode_emoji is passed * Fix typo in docs * Use `ctx.respond` in favor of `ctx.send` * Use `ctx.respond` in favor of `ctx.send` * Added new embedded activites with documentation. (#267) * Added new embedded activities * Removed chess and renamed youtube2 * Documented `EmbeddedActivity` Enumeration * renamed youtube_advance to watch_together and added dev version of it Co-authored-by: Lala Sabathil <aiko@aitsys.dev> * Updated docs with the new naming convention Co-authored-by: Lala Sabathil <aiko@aitsys.dev> Co-authored-by: Lala Sabathil <aiko@aitsys.dev> * add support for sending file(s) in interaction response (#263) * add support for sending file(s) in interaction response * update docstring * fix * add ephemeral attribute to Attachment * use dict.get to avoid KeyErrors (#268) * Revert "Add a dunder len to Message (#176)" (#270) This reverts commit 2858bd1. * Add missing flags * Fix typo * Typos .-. * Fix typo Co-authored-by: Sonic4999 <sonictbm@gmail.com> Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: Izhar Ahmad <54180221+nerdguyahmad@users.noreply.github.com> Co-authored-by: PGamerX <websitedesigner123456@gmail.com> Co-authored-by: Gracie <87055757+Grace-codes@users.noreply.github.com> Co-authored-by: Middledot <78228142+Middledot@users.noreply.github.com> Co-authored-by: DeviousLab <deviouslab@gmail.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Co-authored-by: Aomi Vel <69065737+AomiVel@users.noreply.github.com> Co-authored-by: BobDotCom <71356958+BobDotCom@users.noreply.github.com> Co-authored-by: Dorukyum <doruk.ak@hotmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ian Webster <ianw_github@ianww.com> Co-authored-by: Cheeseboy8020 <68305035+Cheeseboy8020@users.noreply.github.com> Co-authored-by: proguy914629 <74696067+proguy914629bot@users.noreply.github.com> Co-authored-by: Zeffo <43495198+zeffo@users.noreply.github.com> Co-authored-by: Prince Raj <68418241+Prince2347X@users.noreply.github.com> Co-authored-by: Lala Sabathil <aiko@aitsys.dev> Co-authored-by: Lala Sabathil <aiko@aiko-it-systems.eu>
Update documentation for #254
Summary
This Pull Request adds support for Role Icons. This addresses #205.
Checklist