def _list_shop(self, ctx):
"""Shows a list of all the shop items. Roles are blue."""
user = ctx.message.author
settings = self.check_server_settings(user.server)
shop_name = settings["Config"]["Shop Name"]
column1 = ["[{}]".format(subdict["Item Name"].title())
if "Role" in subdict else subdict["Item Name"].title()
for subdict in settings["Shop List"].values()]
column2 = [subdict["Quantity"] for subdict in settings["Shop List"].values()]
column3 = [subdict["Item Cost"] for subdict in settings["Shop List"].values()]
column4_raw = [subdict["Discount"] for subdict in settings["Shop List"].values()]
column4 = [x + "%" if x != "0" else "None" for x in list(map(str, column4_raw))]
if not column1:
await self.bot.say("There are no items for sale in the shop.")
else:
data, header = self.table_builder(settings, column1, column2,
column3, column4, shop_name)
msg = await self.shop_table_split(user, data)
await self.shop_list_output(settings, msg, header)
评论列表
文章目录