mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2024-11-23 20:45:06 +08:00
寄.png
This commit is contained in:
parent
680df057e3
commit
6b70ca7ebe
|
@ -24,7 +24,7 @@ version = "0.20.2"
|
||||||
# features = ["auto-initialize"]
|
# features = ["auto-initialize"]
|
||||||
|
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
rust_socketio = { path = "../../../rust-socketio/socketio" }
|
rust_socketio = { path = "D:/githubs/rust-socketio/socketio" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
// 指定 pyo3 的绑定对象
|
// 指定 pyo3 的绑定对象
|
||||||
fn pyo3_config() {
|
fn pyo3_config() {
|
||||||
// PYO3_PYTHON=xxxx
|
// PYO3_PYTHON=xxxx
|
||||||
|
@ -16,5 +17,5 @@ fn pyo3_config() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
pyo3_config();
|
// pyo3_config();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
// use inline_python::{python, Context};
|
// use inline_python::{python, Context};
|
||||||
|
|
||||||
use pyo3::prelude::*;
|
// use pyo3::prelude::*;
|
||||||
|
|
||||||
#[pyclass]
|
// #[pyclass]
|
||||||
#[pyo3(name = "BotStatus")]
|
// #[pyo3(name = "BotStatus")]
|
||||||
pub struct BotStatusPy {}
|
// pub struct BotStatusPy {}
|
||||||
|
|
||||||
pub fn run() {
|
// pub fn run() {
|
||||||
//
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
// pub fn run() {
|
// pub fn run() {
|
||||||
// let con: Context = python! {
|
// let con: Context = python! {
|
||||||
|
|
6
main.py
6
main.py
|
@ -4,9 +4,9 @@ import argparse
|
||||||
# from lib_not_dr.types import Options
|
# from lib_not_dr.types import Options
|
||||||
from lib_not_dr.loggers import config
|
from lib_not_dr.loggers import config
|
||||||
|
|
||||||
from data_struct import SendMessage, ReplyMessage, get_config, BotConfig, BotStatus
|
from data_struct import get_config, BotConfig, BotStatus
|
||||||
|
|
||||||
_version_ = "0.3.0"
|
_version_ = "0.3.1"
|
||||||
|
|
||||||
logger = config.get_logger("bot")
|
logger = config.get_logger("bot")
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ if __name__ == "__main__":
|
||||||
# --debug
|
# --debug
|
||||||
# --config=config.toml
|
# --config=config.toml
|
||||||
# -n --no-notice
|
# -n --no-notice
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser(description=f"icalingua bot v{_version_}")
|
||||||
parser.add_argument("-d", "--debug", action="store_true")
|
parser.add_argument("-d", "--debug", action="store_true")
|
||||||
parser.add_argument("-n", "--no-notice", action="store_true")
|
parser.add_argument("-n", "--no-notice", action="store_true")
|
||||||
parser.add_argument("-c", "--config", type=str)
|
parser.add_argument("-c", "--config", type=str)
|
||||||
|
|
|
@ -39,11 +39,11 @@ def safe_eval(code: str) -> str:
|
||||||
"decimal": decimal,
|
"decimal": decimal,
|
||||||
"random": random,
|
"random": random,
|
||||||
"__import__": "<built-in function __import__>",
|
"__import__": "<built-in function __import__>",
|
||||||
"globals": "也别惦记你那个 globals 了",
|
"globals": "<built-in function globals>",
|
||||||
"compile": "想得美",
|
"compile": "<built-in function compile>",
|
||||||
"help": "虽然但是 help 也不行",
|
"help": "<built-in function help>",
|
||||||
"exit": "不许 exit",
|
"exit": "<built-in function exit>",
|
||||||
"input": "你想干嘛",
|
"input": "<built-in function input>",
|
||||||
"return": "别惦记你那个 return 了",
|
"return": "别惦记你那个 return 了",
|
||||||
"getattr": "<built-in function getattr>",
|
"getattr": "<built-in function getattr>",
|
||||||
"setattr": "<built-in function setattr>",
|
"setattr": "<built-in function setattr>",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user