Files
conquest/src/server/task/dispatcher.nim

15 lines
545 B
Nim
Raw Normal View History

import argparse, times, strformat, terminal, nanoid, sequtils
2025-07-15 23:26:54 +02:00
import ../../types
2025-07-15 23:26:54 +02:00
proc createTask*(cq: Conquest, command: CommandType, args: string, message: string) =
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)
cq.writeLine(fgBlack, styleBright, fmt"[{date}] [*] ", resetStyle, message)