Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

[roleutils] a simple cmd to change the role icon #144

Open
wants to merge 2 commits into
base: dpy2
Choose a base branch
from

Conversation

japandotorg
Copy link
Contributor

@japandotorg japandotorg commented Nov 16, 2022

The title says it all, even tho I feel like it’s kinda unnecessary but can be useful at the same time, for instance it can be very useful for mobile users.

roleutils/roles.py Outdated Show resolved Hide resolved
await role.edit(display_icon=await icon.read())
elif isinstance(icon, discord.PartialEmoji) and icon.is_custom_emoji():
await role.edit(display_icon=await icon.read())
elif isinstance(icon, str) and icon.startswith("http"):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to be accepting any arbitrary URL to make a request to as this could lead to security issues. Rather than fetching content from the image itself, I'd do these two things:

  • check message.attachments and see if there's an image attachment that could be set as an icon
  • check message.embeds and see if there's an embedded image that could be set as an icon

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, understandable, I'm out for the week, will be done when i'm back home and have a stable internet.

@phenom4n4n
Copy link
Owner

Thanks for the PR. Please see the requested changes and implement them.

Co-authored-by: PhenoM4n4n <61065078+phenom4n4n@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants