2025-07-09 14:38:30 +02:00
|
|
|
import nanoid, sequtils, strutils, strformat, terminal, times, json
|
|
|
|
|
import ../types
|
|
|
|
|
import ../db/database
|
|
|
|
|
|
|
|
|
|
# Generic task creation procedure
|
2025-07-14 22:14:27 +02:00
|
|
|
proc createTask*(cq: Conquest, command: CommandType, args: string, message: string) =
|
2025-07-09 14:38:30 +02:00
|
|
|
let
|
|
|
|
|
date = now().format("dd-MM-yyyy HH:mm:ss")
|
|
|
|
|
task = Task(
|
|
|
|
|
id: generate(alphabet=join(toSeq('A'..'Z'), ""), size=8),
|
|
|
|
|
agent: cq.interactAgent.name,
|
|
|
|
|
command: command,
|
|
|
|
|
args: args,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
cq.interactAgent.tasks.add(task)
|
2025-07-15 22:38:01 +02:00
|
|
|
cq.writeLine(fgBlack, styleBright, fmt"[{date}] [*] ", resetStyle, message)
|