mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
🐛 fix(ChatProcess.py): remove "🤔" reaction after processing the message to improve user experience
🐛 fix(ChatProcess.py): handle error when removing "🤔" reaction in case it was already removed 🐛 fix(ChatProcess.py): improve error message when an error occurs during message processing 🐛 fix(ChatProcess.py): set delete_after parameter to 4 seconds for error message to automatically delete after a short period 🐛 fix(cogs/chat.py): fix typo in message.channel.send() method call
This commit is contained in:
@@ -193,15 +193,22 @@ class Chat:
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
await self.message.channel.trigger_typing()
|
await self.message.channel.trigger_typing()
|
||||||
|
await self.message.add_reaction("🤔")
|
||||||
await self.formatContext()
|
await self.formatContext()
|
||||||
await self.createThePrompt()
|
await self.createThePrompt()
|
||||||
await self.getResponse()
|
await self.getResponse()
|
||||||
await self.processResponse()
|
await self.processResponse()
|
||||||
|
await self.message.remove_reaction("🤔", self.message.guild.me)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
try:
|
||||||
|
self.message.remove_reaction("🤔", self.message.guild.me)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
await self.message.channel.send(
|
await self.message.channel.send(
|
||||||
f"""An error occured while processing your message. Please check your settings and try again. If the issue persists, please join uor discord server here: https://discord.gg/pB6hXtUeDv and send the following logs:
|
f"""An error occured while processing your message, we are sorry about that. Please check your settings and try again. If the issue persists, please join uor discord server here: https://discord.gg/pB6hXtUeDv and send the following logs:
|
||||||
```
|
```
|
||||||
{e}
|
{e}
|
||||||
```"""
|
```""",
|
||||||
|
delete_after=4,
|
||||||
)
|
)
|
||||||
raise e
|
raise e
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class Chat(discord.Cog):
|
|||||||
if message.content.startswith("botator!unban"):
|
if message.content.startswith("botator!unban"):
|
||||||
user2ban = message.content.split(" ")[1]
|
user2ban = message.content.split(" ")[1]
|
||||||
await banusr.unbanuser(user2ban)
|
await banusr.unbanuser(user2ban)
|
||||||
await message.chafnnel.send(f"User {user2ban} unbanned !")
|
await message.channel.send(f"User {user2ban} unbanned !")
|
||||||
return
|
return
|
||||||
if str(message.author.id) in banusr.banend_users:
|
if str(message.author.id) in banusr.banend_users:
|
||||||
await asyncio.sleep(2)
|
await asyncio.sleep(2)
|
||||||
|
|||||||
Reference in New Issue
Block a user