Untitled
unknown
plain_text
2 years ago
2.2 kB
9
Indexable
def rank_user(ctx):
level = ctx.author.level
final = levels[str(level + 1)]
rep = int(ctx.author.reputation)
x = rep - int(levels[str(level)])
y = int(levels[str(level + 1)]) - int(levels[str(level)])
percentage = calPercent(x, y)
background = Editor("bt.png")
profile = load_image(str(ctx.author.icon))
# frame=ctx.author.subClient.get_user_info(ctx.author.authorId).avatarFrame
profile = Editor(profile).resize((150, 150)).circle_image()
poppins = ImageFont.truetype("fonts/calibril.ttf", 70)
poppins_small = Font(path="fonts/ss.ttf").poppins(size=30)
square = Canvas((500, 500), "#06FFBF")
square = Editor(square)
square.rotate(30, expand=True)
background.paste(square.image, (600, -250))
background.paste(profile.image, (30, 30))
try:
url = ctx.author.avatarFrame["resourceUrl"]
img1 = zipurl(url)
if img1 != None:
av2 = Editor(img1).resize((180, 180))
background.paste(av2, (16, 14))
except:
pass
background.rectangle((30, 220), width=650, height=40, fill="white", radius=20)
background.bar(
(30, 220),
max_width=650,
height=40,
percentage=percentage,
fill="#2596be",
radius=20,
)
status = ctx.author.accountMembershipStatus
if status == 1:
plus = Editor("on.png").resize((40, 40))
background.paste(plus, (200, 40))
else:
plus = Editor("off.png").resize((40, 40))
background.paste(plus, (200, 40))
sus = str(f"lvl/{level}.png")
ll = Editor(sus).resize((70, 70))
background.text(
(254, 39),
ctx.author.nickname,
font=ff("fonts/unifont-14.0.04.ttf", 45),
color="white",
)
background.paste(ll, (202, 117))
background.rectangle((200, 100), width=350, height=2, fill="#17F3F6")
background.text(
(294, 136),
f" Reputation :{rep}",
font=ff("fonts/ss.ttf", 40),
color="white",
)
return backgroundEditor is loading...