Skip to content

Commit b34e3a7

Browse files
authored
[Leveler] Fix for lvlset profile color default/reset (#183)
* Change "default" to "reset" and adjust text * Adjust help for the command Remove "white" (invalid input) and expand help * [meta] pre-commit styling fix
1 parent bec5782 commit b34e3a7

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

leveler/commands/lvlset/profile.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ async def profilecolors(self, ctx, section: str, color: Union[discord.Color, str
2525
"""Set profile color.
2626
2727
For section, you can choose: `exp`, `rep`, `badge`, `info` or `all`.
28-
For color, you can use: `default`, `white`, `HEX code` (#000000) or `auto`.
28+
For color, you can use:
29+
a color name like `blurple`, a hex code (`#000000`), `auto` for auto-color
30+
or reset the values to their defaults with `reset`.
2931
e.g: `[p]lvlset profile color all #eb4034`"""
3032
user = ctx.author
3133
userinfo = await self.db.users.find_one({"user_id": str(user.id)})
@@ -82,7 +84,7 @@ async def profilecolors(self, ctx, section: str, color: Union[discord.Color, str
8284
set_color = [await self._hex_to_rgb(color, default_a) for color in hex_colors]
8385
else:
8486
set_color = hex_colors[0]
85-
elif color == "default":
87+
elif color == "reset":
8688
if section == "exp":
8789
set_color = default_exp
8890
elif section == "rep":
@@ -101,7 +103,12 @@ async def profilecolors(self, ctx, section: str, color: Union[discord.Color, str
101103
elif isinstance(color, discord.Color):
102104
set_color = (color.r, color.g, color.b, default_a)
103105
else:
104-
await ctx.send("Not a valid color. Must be `default`, `HEX color` or `auto`.")
106+
msg = (
107+
"Not a valid color. "
108+
"Must be a color name like `blurple`, a hex code formatted like `#000000`, "
109+
"`auto` for auto-color or `reset` to reset to the default colors."
110+
)
111+
await ctx.send(msg)
105112
return
106113

107114
if section == "all":
@@ -117,7 +124,7 @@ async def profilecolors(self, ctx, section: str, color: Union[discord.Color, str
117124
}
118125
},
119126
)
120-
elif color == "default":
127+
elif color == "reset":
121128
await self.db.users.update_one(
122129
{"user_id": str(user.id)},
123130
{

leveler/leveler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Leveler(
2929
):
3030
"""A level up thing with image generation!"""
3131

32-
__version__ = "3.0.6"
32+
__version__ = "3.0.7"
3333

3434
# noinspection PyMissingConstructor
3535
def __init__(self, bot: Red):

0 commit comments

Comments
 (0)