mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-10-22 05:52:10 +00:00
Enhance magic8 command response formatting
Format the magic8 command response based on message type.
This commit is contained in:
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)
|
||||
|
||||
Reference in new issue
Block a user