Moved the coloring from <color>[text]<end> to <color>[test]</color>, which allows the discord module to reparse the messages more accurately
This commit is contained in:
@@ -50,11 +50,11 @@ class PresetController:
|
||||
count = self.db.query_single("SELECT COUNT(*) AS count FROM points_presets WHERE name = ?", [name]).count
|
||||
|
||||
if count > 0:
|
||||
return "A preset already exists with the name <highlight>%s<end>." % name
|
||||
return f"A preset already exists with the name <highlight>{name}</highlight>."
|
||||
|
||||
sql = "INSERT INTO points_presets (name, points) VALUES (?,?)"
|
||||
if self.db.exec(sql, [name, points]) > 0:
|
||||
return f"A preset with the name <highlight>{name}<end> was added, worth <green>{points:d}<end> points."
|
||||
return f"A preset with the name <highlight>{name}</highlight> was added, worth <green>{points}</green> points."
|
||||
|
||||
return "Failed to insert new preset in DB."
|
||||
|
||||
@@ -62,9 +62,9 @@ class PresetController:
|
||||
description="Delete preset", sub_command="mod")
|
||||
def presets_rem_cmd(self, _1, _2, preset_id: int):
|
||||
if self.db.exec("DELETE FROM points_presets WHERE preset_id = ?", [preset_id]) > 0:
|
||||
return "Successfully removed preset with ID <highlight>%d<end>." % preset_id
|
||||
return f"Successfully removed preset with ID <highlight>{preset_id}</highlight>."
|
||||
|
||||
return "No preset with given ID <highlight>%d<end>." % preset_id
|
||||
return f"No preset with given ID <highlight>{preset_id}</highlight>."
|
||||
|
||||
@command(command="presets",
|
||||
params=[Const("alter"), Int("preset_id"), Int("new_points")],
|
||||
@@ -75,10 +75,10 @@ class PresetController:
|
||||
|
||||
if preset:
|
||||
if self.db.exec("UPDATE points_presets SET points = ? WHERE preset_id = ?", [new_points, preset_id]) > 0:
|
||||
return f"Successfully updated the preset, <highlight>{preset.name}<end>, " \
|
||||
f"to dish out <green>{new_points:d}<end> points instead of <red>{preset.points:d}<end>."
|
||||
return f"Successfully updated the preset, <highlight>{preset.name}</highlight>, " \
|
||||
f"to dish out <green>{new_points}</green> points instead of <red>{preset.points}</red>."
|
||||
|
||||
return "Failed to update preset with ID <highlight>%d<end>." % preset_id
|
||||
return f"Failed to update preset with ID <highlight>{preset_id}</highlight>."
|
||||
|
||||
@command(command="presets", params=[], access_level="admin",
|
||||
description="See list of points presets")
|
||||
@@ -94,11 +94,11 @@ class PresetController:
|
||||
|
||||
for preset in presets:
|
||||
add_points_link = self.text.make_chatcmd("Add pts", f"/tell <myname> raid addpts {preset.name}")
|
||||
delete_link = self.text.make_chatcmd("Delete", f"/tell <myname> presets rem {preset.preset_id:d}")
|
||||
blob += f"<highlight>{preset.name}<end> worth <green>{preset.points:d}<end> points " \
|
||||
f"[id: {preset.preset_id:d}]\n | [{add_points_link}] [{delete_link}]\n\n"
|
||||
delete_link = self.text.make_chatcmd("Delete", f"/tell <myname> presets rem {preset.preset_id}")
|
||||
blob += f"<highlight>{preset.name}</highlight> worth <green>{preset.points}</green> points " \
|
||||
f"[id: {preset.preset_id}]\n | [{add_points_link}] [{delete_link}]\n\n"
|
||||
|
||||
return blob
|
||||
|
||||
return "No presets available. " \
|
||||
"To add new presets use <highlight><symbol>presets add preset_name preset_points<end>."
|
||||
"To add new presets use <highlight><symbol>presets add preset_name preset_points</highlight>."
|
||||
|
||||
Reference in New Issue
Block a user