Enhance magic8 command response formatting

Format the magic8 command response based on message type.
This commit is contained in:
Adam Gessaman authored and GitHub committed 2025-12-29 16:01:11 -08:00
1 parent e62765baf0
commit a7b14df9ef
1 file changed
+10 -1
@@ -36,4 +36,13 @@ class Magic8Command(BaseCommand):
async def execute(self, message: MeshMessage) -> bool:
"""Execute the magic8 command"""
answer = magic8()
return await self.send_response(message, answer)
# Format response with sender mention for channel messages, without for DMs
if message.is_dm:
response = f"🎱 {answer}"
else:
sender = message.sender_id or "Unknown"
response = f"🎱 @[{sender}] {answer}"
return await self.send_response(message, response)