diff options
| author | 2025-10-13 05:51:01 +0300 | |
|---|---|---|
| committer | 2025-10-13 05:51:01 +0300 | |
| commit | f8db5c3e3c4bb426e76e10993b09debdb84b0b57 (patch) | |
| tree | b79763459752153b2385645a4fabfa25641909ee /src/bot/impl.lisp | |
| parent | Move do-call &co to a transport package (diff) | |
| download | ukkoclot-f8db5c3e3c4bb426e76e10993b09debdb84b0b57.tar.gz ukkoclot-f8db5c3e3c4bb426e76e10993b09debdb84b0b57.tar.xz ukkoclot-f8db5c3e3c4bb426e76e10993b09debdb84b0b57.zip | |
Move bot/impl to state
Diffstat (limited to 'src/bot/impl.lisp')
| -rw-r--r-- | src/bot/impl.lisp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/bot/impl.lisp b/src/bot/impl.lisp deleted file mode 100644 index ea1aa03..0000000 --- a/src/bot/impl.lisp +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | ;; SPDX-License-Identifier: EUPL-1.2 | ||
| 2 | ;; SPDX-FileCopyrightText: 2025 Uko Kokņevičs <perkontevs@gmail.com> | ||
| 3 | (defpackage :ukkoclot/bot/impl | ||
| 4 | (:use :c2cl :iterate :ukkoclot/config) | ||
| 5 | (:export | ||
| 6 | :bot :bot-p :make-bot | ||
| 7 | |||
| 8 | :bot-config :bot-db :bot-base-uri :bot-power-on :bot-username% :bot-id%)) | ||
| 9 | (in-package :ukkoclot/bot/impl) | ||
| 10 | |||
| 11 | (defstruct (bot (:constructor make-bot%)) | ||
| 12 | (config (error "No value given for config") :read-only t) | ||
| 13 | (db (error "No value given for DB") :read-only t) | ||
| 14 | (base-uri (error "No value given for base-uri") :read-only t) | ||
| 15 | (power-on t :type boolean) | ||
| 16 | (username% nil :type (or string null)) | ||
| 17 | (id% nil :type (or integer null))) | ||
| 18 | |||
| 19 | (defun make-bot (config db) | ||
| 20 | (let ((base-uri (concatenate 'string | ||
| 21 | "https://api.telegram.org/bot" | ||
| 22 | (config-bot-token config) "/"))) | ||
| 23 | (make-bot% :config config :db db :base-uri base-uri))) | ||