Compare commits

...
3 changed files with 6 additions and 1 deletions
+1
View File
@@ -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.
+1
View File
@@ -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"]
+4 -1
View File
@@ -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"]: