1 Star 0 Fork 3

朱罗俊/QQchatbot

forked from 蔡子辰/QQchatbot 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
bot.py 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
jiangyuxiaoxiao 提交于 2021-11-13 18:56 . ok
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
#
#
import nonebot
from nonebot.adapters.cqhttp import Bot as CQHTTPBot
from load_dictionary import dictionary_initial
# Custom your logger
#
# from nonebot.log import logger, default_format
# logger.add("error.log",
# rotation="00:00",
# diagnose=False,
# level="ERROR",
# format=default_format)
# You can pass some keyword args config to init function
# 初始化nonebot
nonebot.init()
app = nonebot.get_asgi()
# 以创建一个新进程运行cqhttp,与之对应的,os.system("cqhttp.exe")会阻塞至程序运行结束
# os.popen("cqhttp.exe")
# 连接驱动
driver = nonebot.get_driver()
driver.register_adapter("cqhttp", CQHTTPBot)
#载入词库
dictionary_initial()
# Please DO NOT modify this file unless you know what you are doing!
# As an alternative, you should use command `nb` or modify `pyproject.toml` to load plugins
#初始化插件
nonebot.load_from_toml("pyproject.toml")
# Modify some config / config depends on loaded configs
#
# config = driver.config
# do something...
if __name__ == "__main__":
nonebot.logger.warning("Always use `nb run` to start the bot instead of manually running!")
nonebot.run(app="__mp_main__:app")
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/zhuluojun/QQchatbot.git
git@gitee.com:zhuluojun/QQchatbot.git
zhuluojun
QQchatbot
QQchatbot
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385