Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
115e3dd3d0 | ||
|
|
9ef2acf34c | ||
|
|
4a15c63e8c | ||
|
|
4c6279b444 |
@@ -19,6 +19,7 @@ class PostHighscores(commands.Cog, name="Post Highscores"):
|
|||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
|
||||||
@commands.command(name="post-scores")
|
@commands.command(name="post-scores")
|
||||||
|
@commands.has_permissions(administrator=True)
|
||||||
async def post_highscores(self, ctx: commands.Context):
|
async def post_highscores(self, ctx: commands.Context):
|
||||||
"""
|
"""
|
||||||
A command which posts the highscore in the designated channel.
|
A command which posts the highscore in the designated channel.
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class Score(commands.Cog, name="Score"):
|
|||||||
Usage:
|
Usage:
|
||||||
```
|
```
|
||||||
?score "Boss Name" "Category" "score"
|
?score "Boss Name" "Category" "score"
|
||||||
|
This command still works if you prefer to use it over the ui.
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
verification_channel_id = highscores_data["verification_channel_id"]
|
verification_channel_id = highscores_data["verification_channel_id"]
|
||||||
|
|||||||
+7
-4
@@ -21,7 +21,7 @@ def format_highscore_message(boss_name: str):
|
|||||||
|
|
||||||
# Gather all categories and add to string
|
# Gather all categories and add to string
|
||||||
for key, value in boss_data["categories"].items():
|
for key, value in boss_data["categories"].items():
|
||||||
ret_string += f"{key}".ljust(30, " ")
|
ret_string += f"{key}".ljust(25, " ")
|
||||||
ret_string += "\n"
|
ret_string += "\n"
|
||||||
|
|
||||||
highscore_size = highscores_config["highscore_size"]
|
highscore_size = highscores_config["highscore_size"]
|
||||||
@@ -31,9 +31,9 @@ def format_highscore_message(boss_name: str):
|
|||||||
for key, value in boss_data["categories"].items():
|
for key, value in boss_data["categories"].items():
|
||||||
if len(value) > i:
|
if len(value) > i:
|
||||||
score = value[i]
|
score = value[i]
|
||||||
ret_string += f"{i+1}: {score[0]} - {score[1]}".ljust(30, " ")
|
ret_string += f"{i+1}: {score[0]} - {score[1]}".ljust(25, " ")
|
||||||
else:
|
else:
|
||||||
ret_string += f"{i+1}: submit your score".ljust(30, " ")
|
ret_string += f"{i+1}: submit your score".ljust(25, " ")
|
||||||
ret_string += "\n"
|
ret_string += "\n"
|
||||||
|
|
||||||
return ret_string + "```"
|
return ret_string + "```"
|
||||||
@@ -72,7 +72,7 @@ async def submit_score(
|
|||||||
@param boss: the boss to add score to
|
@param boss: the boss to add score to
|
||||||
@param category: the category to add score to
|
@param category: the category to add score to
|
||||||
@param user: user who submitted score
|
@param user: user who submitted score
|
||||||
@param score: score (int) to add
|
@param score: score to add
|
||||||
"""
|
"""
|
||||||
# TODO update user submission to not have dupe users
|
# TODO update user submission to not have dupe users
|
||||||
|
|
||||||
@@ -82,6 +82,9 @@ async def submit_score(
|
|||||||
else:
|
else:
|
||||||
config_category = category
|
config_category = category
|
||||||
|
|
||||||
|
# capping to 12 characters because runescape names are 12 characters long.
|
||||||
|
user = user[:12]
|
||||||
|
|
||||||
# create score tuple for either time or int
|
# create score tuple for either time or int
|
||||||
# define sort index
|
# define sort index
|
||||||
if highscores_config["categories"][config_category]["is_time_record"]:
|
if highscores_config["categories"][config_category]["is_time_record"]:
|
||||||
|
|||||||
Reference in New Issue
Block a user