Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 6aeb576

Browse files
committed
Disable Discord oneboxes
1 parent 55250e7 commit 6aeb576

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/discord/bot/persona_replier.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,18 @@ def handle_interaction!
3838
end
3939
end
4040

41-
discord_reply = full_reply.last.first
41+
discord_reply = wrap_links(full_reply.last.first)
4242

4343
if @reply_response.nil?
4444
create_reply(discord_reply)
4545
else
4646
update_reply(discord_reply)
4747
end
4848
end
49+
50+
def wrap_links(text)
51+
text.gsub(%r{(?<url>https?://[^\s]+)}, "<\\k<url>>")
52+
end
4953
end
5054
end
5155
end

0 commit comments

Comments
 (0)