fixed command name and output

This commit is contained in:
phixxy 2024-05-27 01:59:03 -07:00
parent cd51b729f7
commit 601bb682f7

View file

@ -20,8 +20,9 @@ class SaltStraw(BotBaseCog):
self.url = "https://saltandstraw.com/pages/flavors" self.url = "https://saltandstraw.com/pages/flavors"
@commands.command() @commands.command()
async def test(self, ctx): async def icecream(self, ctx):
await self.parse() message = await self.parse()
await ctx.send(message)
self.logger.info(f"SaltStraw command called by {ctx.author.name}") self.logger.info(f"SaltStraw command called by {ctx.author.name}")
async def parse(self): async def parse(self):
@ -36,8 +37,11 @@ class SaltStraw(BotBaseCog):
for item in parent_sets: for item in parent_sets:
child_set = item.find_all("div", limit=3) #limit=3 skips everything past each description, i.e. ingredients/allergens child_set = item.find_all("div", limit=3) #limit=3 skips everything past each description, i.e. ingredients/allergens
flavor_dict[child_set[0].string] = child_set[1].string #grabbing only the title and description flavor_dict[child_set[0].string] = child_set[1].string #grabbing only the title and description
message = ""
for item in flavor_dict: for item in flavor_dict:
print(f"\n{item}:\n{flavor_dict[item]}\n\n") print(f"\n{item}:\n{flavor_dict[item]}\n\n")
message += f"\n{item}:\n{flavor_dict[item]}\n\n"
return message
async def setup(bot): async def setup(bot):
await bot.add_cog(SaltStraw(bot)) await bot.add_cog(SaltStraw(bot))