Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit 9e14a74

Browse files
committed
A
1 parent cabd1d8 commit 9e14a74

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

main.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import asyncio
2+
from datetime import timedelta
3+
from os import name
24
import codingame
35
import discord
46
import json
@@ -104,4 +106,25 @@ async def next(ctx):
104106
embed.set_footer(text="Time before start: " + str(coc.time_before_start))
105107
await ctx.send(embed=embed)
106108

109+
#@bot.command(name="leaderboard", description="get your leaderboard")
110+
#async def leaderboard(ctx, arg=None):
111+
# if not arg:
112+
# file = open("./config/db.json", "r+")
113+
# file_data = json.load(file)
114+
# if not file_data[str(ctx.author.id)]["user"]:
115+
# await ctx.send("This command required an argument or to be linked")
116+
# return(84)
117+
# else:
118+
# codingamer = client.get_codingamer(file_data[str(ctx.author.id)]["user"])
119+
# else:
120+
# codingamer = client.get_codingamer(arg)
121+
# page = codingamer.rank/100
122+
# place = codingamer.rank % 100
123+
# global_leaderboard = client.get_global_leaderboard(page=page + 1)
124+
# print(global_leaderboard.users[place].pseudo)
125+
# embed=discord.Embed(title="Leaderboard", color=Color.blurple())
126+
# for i in range(-2, 3):
127+
# embed.add_field(name=str(codingamer.rank + i) + " ème " + str(global_leaderboard.users[place + i].pseudo), value="[See profil](https://www.codingame.com/profile/" + global_leaderboard.users[place + i].public_handle + ")", inline=False)
128+
# await ctx.send(embed=embed)
129+
107130
bot.run(config["token"])

0 commit comments

Comments
 (0)