Comments (6)
Hey! Thanks for using our library!
Making a leaderboard with discordSuperUtils is a VERY easy task.
simply,
@bot.command()
async def leaderboard(ctx):
guild_leaderboard = LevelingManager.get_leaderboard(ctx.guild)[:10]
formatted_leaderboard = [f"Member: {x.member}, XP: {x.xp}" for x in guild_leaderboard]
await discordSuperUtils.PageManager(ctx, discordSuperUtils.generate_embeds(
formatted_leaderboard,
title="Leveling Leaderboard",
fields=25,
description=f"Leaderboard of {ctx.guild}"
)).run()
If you have any other questions, take a look at our documentation, alternatively, join our discord server!
from discord-super-utils.
That issue will be fixed in the next release, it will be released later today
from discord-super-utils.
Its working only with one person but if there is more people on the leaderboard it gets error:
Smth with other.net i guess
self.net is working fine.
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "bot4.py", line 29, in leaderboard
guild_leaderboard = LevelingManager.get_leaderboard(ctx.guild)[:10]
File "/serv/bot4/discordSuperUtils/Leveling.py", line 122, in get_leaderboard
members.sort()
File "/serv/bot4/discordSuperUtils/Leveling.py", line 26, in __lt__
return self.net < other.net
AttributeError: 'LevelingAccount' object has no attribute 'net'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/usr/local/lib/python3.7/dist-packages/discord/ext/commands/core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/usr/local/lib/python3.7/dist-packages/discord/ext/commands/core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'LevelingAccount' object has no attribute 'net'```
from discord-super-utils.
0.1.3 has been released, that issue has been fixed.
from discord-super-utils.
The order is wrong, any way to fix this without downloading whole release? Last time i couldnt import my database and we had to start collecting our levels from the beginning :P
from discord-super-utils.
Yes, the reversed function to reverse the order.
We should make it reversed by default, sorry.
from discord-super-utils.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord-super-utils.