chore: auto-commit from dashboard
This commit is contained in:
@@ -1104,9 +1104,19 @@ def create_bot(config: Config) -> discord.Client:
|
||||
# Only send the final combined response if no intermediates
|
||||
# were delivered (avoids duplicating content).
|
||||
if sent_count == 0:
|
||||
chunks = split_message(response)
|
||||
for chunk in chunks:
|
||||
await message.channel.send(chunk)
|
||||
if response.startswith("__AUDIO__:"):
|
||||
wav_path = response[len("__AUDIO__:"):]
|
||||
await message.channel.send(
|
||||
file=discord.File(wav_path, filename="echo-audio.wav")
|
||||
)
|
||||
try:
|
||||
os.unlink(wav_path)
|
||||
except OSError:
|
||||
pass
|
||||
else:
|
||||
chunks = split_message(response)
|
||||
for chunk in chunks:
|
||||
await message.channel.send(chunk)
|
||||
except Exception:
|
||||
logger.exception("Error processing message from %s", message.author)
|
||||
await message.channel.send(
|
||||
|
||||
Reference in New Issue
Block a user