From 54f729b3e2315e7d70f8daa01132cb233d302b1c Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Wed, 10 Apr 2019 02:12:38 -0400 Subject: fix discord message length issues --- src/commands/meme/history.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/commands/meme/history.rs') diff --git a/src/commands/meme/history.rs b/src/commands/meme/history.rs index dd88320..7a38325 100644 --- a/src/commands/meme/history.rs +++ b/src/commands/meme/history.rs @@ -308,6 +308,15 @@ pub fn query(_: &mut Context, msg: &Message, mut args: Args) -> Result<()> { }) .collect::>>()? .into_iter() + .scan(0, |state, line| { + *state = *state + line.len() + 1; + + if *state < 2000 { + Some(line) + } else { + None + } + }) .join("\n"); if result.len() == 0 { -- cgit v1.3.1