Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,10 +907,34 @@ async def handle_summarize_preview_ctx(self, interaction, message):
# Placeholder: Implement summarization logic here
await interaction.response.send_message("📝 Summarization not implemented yet.", ephemeral=True)

@commands.command(name="ping")
async def ping_command(self, ctx: commands.Context):
await safe_send(ctx, content="🏓 Pong! Bot is responding.")

@commands.Cog.listener()
async def on_message(self, message: discord.Message):
if message.author.bot:
return
try:
await self.bot.process_commands(message)
if not message.content:
return
links = re.findall(URL_REGEX, message.content)
if not links:
return
filtered = []
for link in links:
if not is_valid_url(link):
continue
if is_media_url(link):
continue
filtered.append(link)
if not filtered:
return
for link in filtered:
await self._handle_link(message, link)
except Exception as e:
logger.error(f"on_message failed: {e}", exc_info=True)
await self.bot.process_commands(message)
if not message.content:
return
Expand Down Expand Up @@ -998,6 +1022,8 @@ async def on_ready():
╚═══════════════════════════════════════════════╝
"""
logger.info(ready_banner)
if not bot.intents.message_content:
logger.warning("Message content intent is disabled; link detection will not work.")


@bot.event
Expand Down
Loading