I have read and understand the Cogboard Bounty rules
Bounty Request Format:
SaraCaterina#1015
I need leaderboards to print out top 10 users with certain values from a stored config. This will be copied and pasted to be used as a function in my other cogs in case I need leaderboards for other stuff. Leaderboards will be global.
Example:
import discord
from redbot.core import Config
def __init__(self, bot: Red):
super().__init__()
self.bot = bot
userdata = {
"userdata": {
"value": 0
}
}
self.config = Config.get_conf(self, 123456789)
self.config.register_user(**userdata)
@commands.command()
async def valueset(self, ctx, value):
"""Set value"""
await self.config.user(author).userdata.value.set(value)
await ctx.send("Value has been set")
@commands.command()
async def value(self, ctx):
"""Recall value"""
v = await self.config.user(author).userdata.value.()
await ctx.send(f"Your value is {v}")
@commands.command()
async def topvalue(self, ctx):
"""Value leaderboards"""
await ctx.send(f"Top 10:")
Payment: $10 via PayPal
V3