I'm developing discord bot on discord.py with slash commands (I am using discord-py-slash-command version 3.0.3 library for this). Recently, error messages have been sent to my hosting console (heroku), but the command is executed successfully. There are no errors on the local hosting. Who knows what the problem is?
Error message:
2022-06-03T19:15:09.003586+00:00 app[worker.1]: An exception has occurred while executing command `botstat`:
2022-06-03T19:15:09.003594+00:00 app[worker.1]: Traceback (most recent call last):
2022-06-03T19:15:09.003595+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/discord_slash/client.py", line 1353, in invoke_command
2022-06-03T19:15:09.003595+00:00 app[worker.1]: await func.invoke(ctx, **args)
2022-06-03T19:15:09.003595+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/discord_slash/model.py", line 210, in invoke
2022-06-03T19:15:09.003596+00:00 app[worker.1]: return await self.func(*args, **kwargs)
2022-06-03T19:15:09.003596+00:00 app[worker.1]: File "/app/main.py", line 87, in botstat
2022-06-03T19:15:09.003596+00:00 app[worker.1]: await ctx.send(embed = embed)
2022-06-03T19:15:09.003597+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/discord_slash/context.py", line 256, in send
2022-06-03T19:15:09.003598+00:00 app[worker.1]: await self._http.post_initial_response(json_data, self.interaction_id, self._token)
2022-06-03T19:15:09.003599+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.10/site-packages/discord/http.py", line 250, in request
2022-06-03T19:15:09.003600+00:00 app[worker.1]: raise NotFound(r, data)
2022-06-03T19:15:09.003601+00:00 app[worker.1]: discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction```
Command code:
@slash.slash(description="Bot statistic")
async def botstat(ctx):
global members
members = 0
for guild in bot.guilds:
members += guild.member_count - 1
embed = discord.Embed(color = 0xff9900, title = 'Bot statistic', description=f'Statistic: guilds: {len(bot.guilds)}Users: {members}Tech info: Ping: {round(bot.latency * 1000)} ms Uptime: {datetime.timedelta(seconds=int(round(time.time()-startTime)))} Using CPU: {psutil.cpu_percent()}% Using virual memory: {psutil.virtual_memory().percent}%')
await ctx.send(embed = embed)
print("botstat command used")