Skip to content

Commit

Permalink
Merge pull request #71 from FuseFairy/master
Browse files Browse the repository at this point in the history
fix  #70
  • Loading branch information
FuseFairy committed May 15, 2023
2 parents 3164f4a + c25bca8 commit c0d6dd5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
25 changes: 13 additions & 12 deletions cogs/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,19 @@ class Event(Cog_Extension):
async def on_message(self, message: discord.Message):
if message.author == self.bot.user:
return
if self.bot.user in message.mentions and (not MENTION_CHANNEL_ID or message.channel.id == MENTION_CHANNEL_ID):
content = re.sub(r'<@.*?>', '', message.content).strip()
if len(content) > 0:
username = str(message.author)
channel = str(message.channel)
logger.info(f"\x1b[31m{username}\x1b[0m : '{content}' ({channel}) [Style: {conversation_style}]")
task = asyncio.create_task(send_message(chatbot, message, content))
await asyncio.gather(task)
else:
await message.channel.send(view=DropdownView())
elif MENTION_CHANNEL_ID is not None:
await message.channel.send(f"> **Can only be mentioned at <#{self.bot.get_channel(MENTION_CHANNEL_ID).id}>**")
if self.bot.user in message.mentions:
if not MENTION_CHANNEL_ID or message.channel.id == MENTION_CHANNEL_ID:
content = re.sub(r'<@.*?>', '', message.content).strip()
if len(content) > 0:
username = str(message.author)
channel = str(message.channel)
logger.info(f"\x1b[31m{username}\x1b[0m : '{content}' ({channel}) [Style: {conversation_style}]")
task = asyncio.create_task(send_message(chatbot, message, content))
await asyncio.gather(task)
else:
await message.channel.send(view=DropdownView())
elif MENTION_CHANNEL_ID is not None:
await message.channel.send(f"> **Can only be mentioned at <#{self.bot.get_channel(MENTION_CHANNEL_ID).id}>**")

async def setup(bot):
await bot.add_cog(Event(bot))
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
discord.py==2.2.3
python-dotenv==0.20.0
PyYAML==6.0
EdgeGPT==0.3.8
EdgeGPT==0.3.9

0 comments on commit c0d6dd5

Please sign in to comment.