mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 03:40:11 +01:00
fix(userinfo): remove unused functions
This commit is contained in:
@@ -4,7 +4,7 @@ from discord import app_commands
|
|||||||
import aiohttp
|
import aiohttp
|
||||||
import asyncio
|
import asyncio
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from PIL import Image, ImageDraw
|
from PIL import Image
|
||||||
import re
|
import re
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
|
|
||||||
@@ -198,31 +198,6 @@ async def get_published_listing(bot, sku_id):
|
|||||||
return None
|
return None
|
||||||
return await resp.json()
|
return await resp.json()
|
||||||
|
|
||||||
async def get_guild_member(bot, guild_id, user_id):
|
|
||||||
headers = {'Authorization': f'Bot {bot.http.token}'}
|
|
||||||
|
|
||||||
async with aiohttp.ClientSession() as session:
|
|
||||||
async with session.get(
|
|
||||||
f'https://discord.com/api/v10/guilds/{guild_id}/members/{user_id}',
|
|
||||||
headers=headers
|
|
||||||
) as resp:
|
|
||||||
if resp.status != 200:
|
|
||||||
return None
|
|
||||||
return await resp.json()
|
|
||||||
|
|
||||||
async def get_guild_data(bot, guild_id):
|
|
||||||
headers = {'Authorization': f'Bot {bot.http.token}'}
|
|
||||||
|
|
||||||
async with aiohttp.ClientSession() as session:
|
|
||||||
async with session.get(
|
|
||||||
f'https://discord.com/api/v10/discovery/{guild_id}/clan',
|
|
||||||
headers=headers
|
|
||||||
) as resp:
|
|
||||||
if resp.status == 200:
|
|
||||||
return await resp.json()
|
|
||||||
|
|
||||||
return None
|
|
||||||
|
|
||||||
def userinfo_command():
|
def userinfo_command():
|
||||||
@commands.hybrid_command(
|
@commands.hybrid_command(
|
||||||
name="userinfo",
|
name="userinfo",
|
||||||
@@ -279,7 +254,6 @@ def userinfo_command():
|
|||||||
badges.append(f"[{BADGE_ICONS['guild_booster_lvl9']}]({BADGE_URLS['premium']})")
|
badges.append(f"[{BADGE_ICONS['guild_booster_lvl9']}]({BADGE_URLS['premium']})")
|
||||||
badges.append(f"[{BADGE_ICONS['quest_completed']}]({BADGE_URLS['quest_completed']})")
|
badges.append(f"[{BADGE_ICONS['quest_completed']}]({BADGE_URLS['quest_completed']})")
|
||||||
badges.append(BADGE_ICONS['username'])
|
badges.append(BADGE_ICONS['username'])
|
||||||
badges.append(BADGE_ICONS['opal'])
|
|
||||||
elif str(target_user.id) == '1376728824108286034':
|
elif str(target_user.id) == '1376728824108286034':
|
||||||
badges.append(BADGE_ICONS['automod'])
|
badges.append(BADGE_ICONS['automod'])
|
||||||
badges.append(BADGE_ICONS['verified_developer'])
|
badges.append(BADGE_ICONS['verified_developer'])
|
||||||
@@ -476,19 +450,16 @@ def userinfo_command():
|
|||||||
if banner_url:
|
if banner_url:
|
||||||
images.append(f'[Banner]({original_banner_link})')
|
images.append(f'[Banner]({original_banner_link})')
|
||||||
|
|
||||||
decoration_data = None
|
|
||||||
if avatar_decoration:
|
if avatar_decoration:
|
||||||
decoration_data = await get_published_listing(bot, avatar_decoration['sku_id'])
|
await get_published_listing(bot, avatar_decoration['sku_id'])
|
||||||
decoration_url = f"https://cdn.discordapp.com/avatar-decoration-presets/{avatar_decoration['asset']}.png?size=4096&passthrough=true"
|
decoration_url = f"https://cdn.discordapp.com/avatar-decoration-presets/{avatar_decoration['asset']}.png?size=4096&passthrough=true"
|
||||||
images.append(f'[Avatar Deco]({decoration_url})')
|
images.append(f'[Avatar Deco]({decoration_url})')
|
||||||
|
|
||||||
nameplate_url = None
|
|
||||||
collectibles = user_data.get('collectibles')
|
collectibles = user_data.get('collectibles')
|
||||||
if collectibles and collectibles.get('nameplate'):
|
if collectibles and collectibles.get('nameplate'):
|
||||||
nameplate = collectibles['nameplate']
|
nameplate = collectibles['nameplate']
|
||||||
nameplate_asset = nameplate['asset']
|
nameplate_asset = nameplate['asset']
|
||||||
nameplate_url = f"https://cdn.discordapp.com/assets/collectibles/{nameplate_asset}static.png"
|
images.append(f'[Nameplate](https://cdn.discordapp.com/assets/collectibles/{nameplate_asset}static.png)')
|
||||||
images.append(f'[Nameplate]({nameplate_url})')
|
|
||||||
|
|
||||||
mutual_guilds = [g for g in bot.guilds if g.get_member(target_user.id)]
|
mutual_guilds = [g for g in bot.guilds if g.get_member(target_user.id)]
|
||||||
display_name = user_data.get('global_name') or user_data.get('username')
|
display_name = user_data.get('global_name') or user_data.get('username')
|
||||||
|
|||||||
Reference in New Issue
Block a user