mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 01:00:12 +00:00
Refactor member actions into members.py
This commit is contained in:
parent
05cf04df03
commit
cae394b4e8
7 changed files with 214 additions and 109 deletions
|
|
@ -36,13 +36,14 @@ async def system_set(ctx: CommandContext):
|
|||
property_name = ctx.pop_str(CommandError("You must pass a property name to set.", help=help.edit_system))
|
||||
|
||||
async def avatar_setter(conn, url):
|
||||
user = await utils.parse_mention(ctx.client, url)
|
||||
if user:
|
||||
# Set the avatar to the mentioned user's avatar
|
||||
# Discord pushes webp by default, which isn't supported by webhooks, but also hosts png alternatives
|
||||
url = user.avatar_url.replace(".webp", ".png")
|
||||
if url:
|
||||
user = await utils.parse_mention(ctx.client, url)
|
||||
if user:
|
||||
# Set the avatar to the mentioned user's avatar
|
||||
# Discord pushes webp by default, which isn't supported by webhooks, but also hosts png alternatives
|
||||
url = user.avatar_url.replace(".webp", ".png")
|
||||
|
||||
await system.set_avatar(conn, url)
|
||||
await system.set_avatar(conn, url)
|
||||
|
||||
properties = {
|
||||
"name": system.set_name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue