Kumi
5b500d34b5
Automatically accept room invites on sync Leave rooms if everyone else leaves README update !gptbot dice command Minor fixes
15 lines
No EOL
454 B
Python
15 lines
No EOL
454 B
Python
from nio.events.room_events import RoomMessageText
|
|
from nio.rooms import MatrixRoom
|
|
|
|
|
|
async def command_chat(room: MatrixRoom, event: RoomMessageText, bot):
|
|
prompt = " ".join(event.body.split()[2:])
|
|
|
|
if prompt:
|
|
bot.logger.log("Sending chat message...")
|
|
event.body = prompt
|
|
await bot.process_query(room, event, from_chat_command=True)
|
|
|
|
return
|
|
|
|
await bot.send_message(room, "You need to provide a prompt.", True) |