Make it an importable module
Abandon DuckDB in favor of sqlite3
This commit is contained in:
parent
3a1d1ea86a
commit
55809a9a39
56 changed files with 234 additions and 828 deletions
15
src/gptbot/commands/chat.py
Normal file
15
src/gptbot/commands/chat.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
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)
|
Loading…
Add table
Add a link
Reference in a new issue