From dab1abf4c634cbba8b747aa2b6eacb169fb5d62f Mon Sep 17 00:00:00 2001 From: dece Date: Sun, 12 Dec 2021 18:41:39 +0100 Subject: [PATCH] ambience: use zip_longest to not cut the reply --- edmond/plugins/ambience.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/edmond/plugins/ambience.py b/edmond/plugins/ambience.py index 3dec67b..08f0f7a 100644 --- a/edmond/plugins/ambience.py +++ b/edmond/plugins/ambience.py @@ -15,6 +15,7 @@ Words are actually the requester's name but it could be extended. """ import random +from itertools import zip_longest from edmond.plugin import Plugin from edmond.utils import proc @@ -87,4 +88,7 @@ class AmbiencePlugin(Plugin): return chunk[:index] + word + chunk[index:] def interleave_word(self, chunk, word): - return "".join(a + b for a, b in zip(chunk, word)) + return "".join( + a + b + for a, b in zip_longest(chunk, word, fillvalue='') + )