def _sort_setshop(self, ctx, choice: str):
"""Changes the sorting method for shop listings. Alphabetical, Lowest, Highest"""
server = ctx.message.server
settings = self.check_server_settings(server)
choice = choice.title()
if choice == "Alphabetical":
settings["Config"]["Sort Method"] = "Alphabet"
dataIO.save_json(self.file_path, self.system)
msg = "Changing sorting method to Alphabetical."
elif choice == "Lowest":
settings["Config"]["Sort Method"] = "Lowest"
dataIO.save_json(self.file_path, self.system)
msg = "Setting sorting method to Lowest."
elif choice == "Highest":
settings["Config"]["Sort Method"] = "Highest"
dataIO.save_json(self.file_path, self.system)
msg = "Setting sorting method to Highest."
else:
msg = "Please choose Alphabet, Lowest, or Highest."
await self.bot.say(msg)
评论列表
文章目录