Voxel-Fox-Ltd / Flower

A Discord bot for growing virtual flowers in a virtual garden.
GNU General Public License v2.0
16 stars 12 forks source link

The bot shouldn't reply to messages without the `read message history` permission #63

Closed 4Kaylum closed 1 year ago

4Kaylum commented 3 years ago

The bot hit a Command raised an exception: Forbidden: 403 Forbidden (error code: 160002): Cannot reply without permission to read message history error while running the p.shop command.

Traceback (most recent call last):
  File "/home/kae/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/kae/Flower/./cogs/plant_shop_commands.py", line 470, in shop
    await plant_name_message.reply(f"Planted your **{plant_type.display_name}** seeds!")
  File "/home/kae/.local/lib/python3.8/site-packages/discord/message.py", line 1358, in reply
    return await self.channel.send(content, reference=self, **kwargs)
  File "/home/kae/.local/lib/python3.8/site-packages/voxelbotutils/cogs/utils/custom_bot.py", line 106, in send_button_msg_prop
    return await self._send_button_message(messagable, *args, **kwargs)
  File "/home/kae/.local/lib/python3.8/site-packages/voxelbotutils/cogs/utils/custom_bot.py", line 555, in _send_button_message
    response_data = await messageable._state.http.request(r, json=payload)
  File "/home/kae/.local/lib/python3.8/site-packages/discord/http.py", line 248, in request
    raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 160002): Cannot reply without permission to read message history

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/kae/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/home/kae/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/kae/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 160002): Cannot reply without permission to read message history