Skip to content

Commit

Permalink
Merge pull request #3871 from santiment/trim-message-further
Browse files Browse the repository at this point in the history
Trim discord message further below 2K since it fails with chars limit…
  • Loading branch information
tspenov authored Jul 18, 2023
2 parents d4d075a + 08a2ba7 commit e4c537f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sanbase/discord/command_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1402,8 +1402,8 @@ defmodule Sanbase.Discord.CommandHandler do
end

def trim_message(message) do
if String.length(message) > 1990 do
String.slice(message, 0, 1990) <> "..."
if String.length(message) > 1900 do
String.slice(message, 0, 1900) <> "... (message truncated)"
else
message
end
Expand Down

0 comments on commit e4c537f

Please sign in to comment.