mirror of
https://github.com/Refound-445/nonebot-plugin-nailongremove.git
synced 2025-09-27 02:59:11 +08:00
Compare commits
2 Commits
e3a296e68e
...
d2cb2ca46e
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d2cb2ca46e | ||
![]() |
78412d3393 |
@ -276,6 +276,8 @@ Add the required configurations from the table below to the `.env` file in your
|
||||
|
||||
Whenever a "NaiLong" meme is recognized, it will be retracted and notified.
|
||||
|
||||
Cloud Deployment: The [run_with_napcat_en.ipynb](https://github.com/Refound-445/nonebot-plugin-nailongremove/blob/main/ipynb/run_with_napcat_en.ipynb) file supports one-click deployment on platforms like Kaggle or Huggingface's Spaces. You can complete the bot deployment simply by clicking "Run" and scanning the QR code!
|
||||
|
||||
To store errored images locally (for `SUPERUSERS`): Send "This is [type]"+image, for example: "This is nailong+image",
|
||||
and it will be automatically stored locally. When similarity detection is on, in the next image check, it will
|
||||
prioritize recognizing the images already stored locally.
|
||||
@ -293,6 +295,10 @@ Welcome everyone to join the group for learning and exchange!
|
||||
|
||||
## 📝 Changelog
|
||||
|
||||
### Minor Update
|
||||
|
||||
- Added the [run_with_napcat_en.ipynb](https://github.com/Refound-445/nonebot-plugin-nailongremove/blob/main/ipynb/run_with_napcat_en.ipynb) file, which supports one-click deployment on platforms like Kaggle or Huggingface's Spaces. You can complete the bot deployment simply by clicking "Run" and scanning the QR code!
|
||||
|
||||
### 2.3.5
|
||||
|
||||
- The update adds a feature to select a mute tag, allowing users to choose whether to mute or recall the processing for
|
||||
|
188
ipynb/run_with_napcat.ipynb
Normal file
188
ipynb/run_with_napcat.ipynb
Normal file
@ -0,0 +1,188 @@
|
||||
{
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python",
|
||||
"version": "3.10.12",
|
||||
"mimetype": "text/x-python",
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"pygments_lexer": "ipython3",
|
||||
"nbconvert_exporter": "python",
|
||||
"file_extension": ".py"
|
||||
},
|
||||
"kaggle": {
|
||||
"accelerator": "gpu",
|
||||
"dataSources": [],
|
||||
"isInternetEnabled": true,
|
||||
"language": "python",
|
||||
"sourceType": "notebook",
|
||||
"isGpuEnabled": true
|
||||
}
|
||||
},
|
||||
"nbformat_minor": 5,
|
||||
"nbformat": 4,
|
||||
"cells": [
|
||||
{
|
||||
"id": "626294c0-7107-49e2-8b76-02d8220a4e63",
|
||||
"cell_type": "markdown",
|
||||
"source": "# 1.安装Napcat",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"id": "6c845c9b-df3f-4e3a-b764-24d19a811edc",
|
||||
"cell_type": "code",
|
||||
"source": "!curl -o napcat.sh https://nclatest.znin.net/NapNeko/NapCat-Installer/main/script/install.sh && echo -e \"y\\nn\\n\" | sudo bash napcat.sh",
|
||||
"metadata": {
|
||||
"trusted": true,
|
||||
"execution": {
|
||||
"iopub.status.busy": "2025-01-25T09:46:33.306378Z",
|
||||
"iopub.execute_input": "2025-01-25T09:46:33.306682Z",
|
||||
"iopub.status.idle": "2025-01-25T09:46:34.485925Z",
|
||||
"shell.execute_reply.started": "2025-01-25T09:46:33.306655Z",
|
||||
"shell.execute_reply": "2025-01-25T09:46:34.485178Z"
|
||||
},
|
||||
"_kg_hide-input": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"text": " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0^C\n",
|
||||
"output_type": "stream"
|
||||
}
|
||||
],
|
||||
"execution_count": 1
|
||||
},
|
||||
{
|
||||
"id": "c85256bb-873b-449c-8bc6-32cc46f25c63",
|
||||
"cell_type": "markdown",
|
||||
"source": "# 2.安装需要的库",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"id": "807ad9ba-f9f0-45a4-985b-bdce343751de",
|
||||
"cell_type": "code",
|
||||
"source": "!pip install -q nb-cli nb-cli-plugin-bootstrap nonebot2[fastapi] nonebot-adapter-onebot nonebot-plugin-logpile",
|
||||
"metadata": {
|
||||
"trusted": true,
|
||||
"execution": {
|
||||
"iopub.status.busy": "2025-01-25T09:46:34.487283Z",
|
||||
"iopub.execute_input": "2025-01-25T09:46:34.487608Z"
|
||||
},
|
||||
"_kg_hide-input": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"text": " Preparing metadata (setup.py) ... \u001B[?25l\u001B[?25hdone\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m64.4/64.4 kB\u001B[0m \u001B[31m4.5 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m49.6/49.6 kB\u001B[0m \u001B[31m3.2 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m96.0/96.0 kB\u001B[0m \u001B[31m6.1 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m78.9/78.9 kB\u001B[0m \u001B[31m5.1 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m94.8/94.8 kB\u001B[0m \u001B[31m7.1 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m61.6/61.6 kB\u001B[0m \u001B[31m4.5 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m114.7/114.7 kB\u001B[0m \u001B[31m8.1 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m1.1/1.1 MB\u001B[0m \u001B[31m40.3 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m62.3/62.3 kB\u001B[0m \u001B[31m4.2 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m4.3/4.3 MB\u001B[0m \u001B[31m93.9 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m:00:01\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m425.7/425.7 kB\u001B[0m \u001B[31m25.7 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m469.0/469.0 kB\u001B[0m \u001B[31m28.3 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m442.1/442.1 kB\u001B[0m \u001B[31m30.5 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m71.5/71.5 kB\u001B[0m \u001B[31m5.5 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m3.8/3.8 MB\u001B[0m \u001B[31m75.6 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m:00:01\u001B[0m\n\u001B[?25h",
|
||||
"output_type": "stream"
|
||||
}
|
||||
],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"id": "4b070e72-9521-4f50-a040-6a72614b891b",
|
||||
"cell_type": "markdown",
|
||||
"source": "# 3.初始化Bot并安装插件",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"id": "bb418a49-e179-4852-a80f-f54d8e6c4dde",
|
||||
"cell_type": "code",
|
||||
"source": "!nb bs -y --no-venv -a nonebot.adapters.onebot.v11 nailong\n%cd nailong\n!nb plugin install nonebot-plugin-nailongremove",
|
||||
"metadata": {
|
||||
"trusted": true
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"id": "b6f16f96-fee2-4934-a3e1-ff0cb3d42426",
|
||||
"cell_type": "markdown",
|
||||
"source": "# 4.插件基本配置\n## 可以在此处修改一些基本配置项(**全局唯一可以修改的代码部分**)",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"id": "1e2b820b-2268-43b3-876d-ecce2cb97bf7",
|
||||
"cell_type": "code",
|
||||
"source": "# .env.prod文件设置\ntext='''DRIVER=~fastapi+~httpx+~websockets\nONEBOT_ACCESS_TOKEN='temp123456'\nENVIRONMENT=.dev'''",
|
||||
"metadata": {
|
||||
"trusted": true
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"id": "01584ab9-06ad-4438-8718-51e62447618a",
|
||||
"cell_type": "markdown",
|
||||
"source": "## 此处为Napcat代理相关配置",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"id": "438d22d3-a229-4742-aa30-7082303bb914",
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Napcat代理设置\n",
|
||||
"json = '''{\n",
|
||||
" \"network\": {\n",
|
||||
" \"httpServers\": [],\n",
|
||||
" \"httpClients\": [],\n",
|
||||
" \"websocketServers\": [],\n",
|
||||
" \"websocketClients\": [\n",
|
||||
" {\n",
|
||||
" \"name\": \"nonebot\",\n",
|
||||
" \"enable\": true,\n",
|
||||
" \"url\": \"ws://127.0.0.1:8080/onebot/v11/ws\",\n",
|
||||
" \"messagePostFormat\": \"array\",\n",
|
||||
" \"reportSelfMessage\": true,\n",
|
||||
" \"reconnectInterval\": 5000,\n",
|
||||
" \"token\": \"temp123456\",\n",
|
||||
" \"debug\": false,\n",
|
||||
" \"heartInterval\": 30000\n",
|
||||
" }\n",
|
||||
" ]\n",
|
||||
" },\n",
|
||||
" \"musicSignUrl\": \"\",\n",
|
||||
" \"enableLocalFile2Url\": false,\n",
|
||||
" \"parseMultMsg\": true\n",
|
||||
"}'''\n",
|
||||
"# 读取并修改 .env 文件\n",
|
||||
"env_file_path = '.env.prod' # 设置你的 .env 文件路径\n",
|
||||
"# 打开文件并添加内容\n",
|
||||
"with open(env_file_path, 'w') as file:\n",
|
||||
" file.write(text)\n",
|
||||
"# 配置Napcat\n",
|
||||
"file_path = '/opt/QQ/resources/app/app_launcher/napcat/config/onebot11_3990547445.json'\n",
|
||||
"with open(file_path, 'w') as file:\n",
|
||||
" file.write(json)"
|
||||
],
|
||||
"metadata": {
|
||||
"trusted": true
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"id": "63f3abc0-ccba-4b41-9955-8028e71f5503",
|
||||
"cell_type": "markdown",
|
||||
"source": "# 5.启动Bot,并扫码登录QQ",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"id": "3c8aed7b-6eb5-4a4e-811e-2c502c9cfc87",
|
||||
"cell_type": "code",
|
||||
"source": "!xvfb-run -a qq --no-sandbox & nb run",
|
||||
"metadata": {
|
||||
"trusted": true
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
}
|
||||
]
|
||||
}
|
196
ipynb/run_with_napcat_en.ipynb
Normal file
196
ipynb/run_with_napcat_en.ipynb
Normal file
@ -0,0 +1,196 @@
|
||||
{
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python",
|
||||
"version": "3.10.12",
|
||||
"mimetype": "text/x-python",
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"pygments_lexer": "ipython3",
|
||||
"nbconvert_exporter": "python",
|
||||
"file_extension": ".py"
|
||||
},
|
||||
"kaggle": {
|
||||
"accelerator": "gpu",
|
||||
"dataSources": [],
|
||||
"isInternetEnabled": true,
|
||||
"language": "python",
|
||||
"sourceType": "notebook",
|
||||
"isGpuEnabled": true
|
||||
}
|
||||
},
|
||||
"nbformat_minor": 5,
|
||||
"nbformat": 4,
|
||||
"cells": [
|
||||
{
|
||||
"id": "626294c0-7107-49e2-8b76-02d8220a4e63",
|
||||
"cell_type": "markdown",
|
||||
"source": "# 1.Install Napcat",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"id": "6c845c9b-df3f-4e3a-b764-24d19a811edc",
|
||||
"cell_type": "code",
|
||||
"source": "!curl -o napcat.sh https://nclatest.znin.net/NapNeko/NapCat-Installer/main/script/install.sh && echo -e \"y\\nn\\n\" | sudo bash napcat.sh",
|
||||
"metadata": {
|
||||
"trusted": true,
|
||||
"execution": {
|
||||
"iopub.status.busy": "2025-01-25T09:46:33.306378Z",
|
||||
"iopub.execute_input": "2025-01-25T09:46:33.306682Z",
|
||||
"iopub.status.idle": "2025-01-25T09:46:34.485925Z",
|
||||
"shell.execute_reply.started": "2025-01-25T09:46:33.306655Z",
|
||||
"shell.execute_reply": "2025-01-25T09:46:34.485178Z"
|
||||
},
|
||||
"_kg_hide-input": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"text": " % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0^C\n",
|
||||
"output_type": "stream"
|
||||
}
|
||||
],
|
||||
"execution_count": 1
|
||||
},
|
||||
{
|
||||
"id": "c85256bb-873b-449c-8bc6-32cc46f25c63",
|
||||
"cell_type": "markdown",
|
||||
"source": "# 2.Install Required Libraries",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"id": "807ad9ba-f9f0-45a4-985b-bdce343751de",
|
||||
"cell_type": "code",
|
||||
"source": "!pip install -q nb-cli nb-cli-plugin-bootstrap nonebot2[fastapi] nonebot-adapter-onebot nonebot-plugin-logpile",
|
||||
"metadata": {
|
||||
"trusted": true,
|
||||
"execution": {
|
||||
"iopub.status.busy": "2025-01-25T09:46:34.487283Z",
|
||||
"iopub.execute_input": "2025-01-25T09:46:34.487608Z"
|
||||
},
|
||||
"_kg_hide-input": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"text": " Preparing metadata (setup.py) ... \u001B[?25l\u001B[?25hdone\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m64.4/64.4 kB\u001B[0m \u001B[31m4.5 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m49.6/49.6 kB\u001B[0m \u001B[31m3.2 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m96.0/96.0 kB\u001B[0m \u001B[31m6.1 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m78.9/78.9 kB\u001B[0m \u001B[31m5.1 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m94.8/94.8 kB\u001B[0m \u001B[31m7.1 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m61.6/61.6 kB\u001B[0m \u001B[31m4.5 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m114.7/114.7 kB\u001B[0m \u001B[31m8.1 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m1.1/1.1 MB\u001B[0m \u001B[31m40.3 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m62.3/62.3 kB\u001B[0m \u001B[31m4.2 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m4.3/4.3 MB\u001B[0m \u001B[31m93.9 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m:00:01\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m425.7/425.7 kB\u001B[0m \u001B[31m25.7 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m469.0/469.0 kB\u001B[0m \u001B[31m28.3 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m442.1/442.1 kB\u001B[0m \u001B[31m30.5 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m71.5/71.5 kB\u001B[0m \u001B[31m5.5 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m\n\u001B[2K \u001B[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001B[0m \u001B[32m3.8/3.8 MB\u001B[0m \u001B[31m75.6 MB/s\u001B[0m eta \u001B[36m0:00:00\u001B[0m:00:01\u001B[0m\n\u001B[?25h",
|
||||
"output_type": "stream"
|
||||
}
|
||||
],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"id": "4b070e72-9521-4f50-a040-6a72614b891b",
|
||||
"cell_type": "markdown",
|
||||
"source": "# 3.Initialize The Bot and Install Plugins",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"id": "bb418a49-e179-4852-a80f-f54d8e6c4dde",
|
||||
"cell_type": "code",
|
||||
"source": "!nb bs -y --no-venv -a nonebot.adapters.onebot.v11 nailong\n%cd nailong\n!nb plugin install nonebot-plugin-nailongremove",
|
||||
"metadata": {
|
||||
"trusted": true
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"id": "b6f16f96-fee2-4934-a3e1-ff0cb3d42426",
|
||||
"cell_type": "markdown",
|
||||
"source": [
|
||||
"# 4. Plugin Basic Configuration\n",
|
||||
"## You can modify some basic configuration items here (**the only globally editable code section**)."
|
||||
],
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"id": "1e2b820b-2268-43b3-876d-ecce2cb97bf7",
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# .env.prod File Configuration\n",
|
||||
"text='''DRIVER=~fastapi+~httpx+~websockets\n",
|
||||
"ONEBOT_ACCESS_TOKEN='temp123456'\n",
|
||||
"ENVIRONMENT=.dev'''"
|
||||
],
|
||||
"metadata": {
|
||||
"trusted": true
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"id": "01584ab9-06ad-4438-8718-51e62447618a",
|
||||
"cell_type": "markdown",
|
||||
"source": "## Napcat Proxy-related Configuration",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"id": "438d22d3-a229-4742-aa30-7082303bb914",
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# Napcat Proxy Settings\n",
|
||||
"json = '''{\n",
|
||||
" \"network\": {\n",
|
||||
" \"httpServers\": [],\n",
|
||||
" \"httpClients\": [],\n",
|
||||
" \"websocketServers\": [],\n",
|
||||
" \"websocketClients\": [\n",
|
||||
" {\n",
|
||||
" \"name\": \"nonebot\",\n",
|
||||
" \"enable\": true,\n",
|
||||
" \"url\": \"ws://127.0.0.1:8080/onebot/v11/ws\",\n",
|
||||
" \"messagePostFormat\": \"array\",\n",
|
||||
" \"reportSelfMessage\": true,\n",
|
||||
" \"reconnectInterval\": 5000,\n",
|
||||
" \"token\": \"temp123456\",\n",
|
||||
" \"debug\": false,\n",
|
||||
" \"heartInterval\": 30000\n",
|
||||
" }\n",
|
||||
" ]\n",
|
||||
" },\n",
|
||||
" \"musicSignUrl\": \"\",\n",
|
||||
" \"enableLocalFile2Url\": false,\n",
|
||||
" \"parseMultMsg\": true\n",
|
||||
"}'''\n",
|
||||
"# Read and modify .env file\n",
|
||||
"env_file_path = '.env.prod' # Set your .env file path\n",
|
||||
"# Open the file and add content\n",
|
||||
"with open(env_file_path, 'w') as file:\n",
|
||||
" file.write(text)\n",
|
||||
"# Configure Napcat\n",
|
||||
"file_path = '/opt/QQ/resources/app/app_launcher/napcat/config/onebot11_3990547445.json'\n",
|
||||
"with open(file_path, 'w') as file:\n",
|
||||
" file.write(json)"
|
||||
],
|
||||
"metadata": {
|
||||
"trusted": true
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"id": "63f3abc0-ccba-4b41-9955-8028e71f5503",
|
||||
"cell_type": "markdown",
|
||||
"source": "# 5.Start the Bot and scan the QR code to log in to QQ",
|
||||
"metadata": {}
|
||||
},
|
||||
{
|
||||
"id": "3c8aed7b-6eb5-4a4e-811e-2c502c9cfc87",
|
||||
"cell_type": "code",
|
||||
"source": "!xvfb-run -a qq --no-sandbox & nb run",
|
||||
"metadata": {
|
||||
"trusted": true
|
||||
},
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
}
|
||||
]
|
||||
}
|
@ -262,6 +262,8 @@ pip install nonebot-plugin-nailongremove-base -U
|
||||
|
||||
只要有人发奶龙表情包被识别出来,就会被撤回并提醒。
|
||||
|
||||
云部署:[run_with_napcat.ipynb](https://github.com/Refound-445/nonebot-plugin-nailongremove/blob/main/ipynb/run_with_napcat.ipynb)文件,支持Kaggle或者Huggingface的Space等一键部署,仅需点击运行和扫码即可完成bot部署!
|
||||
|
||||
本地存储报错图片(限`SUPERUSERS`):发送"这是[种类]"+图片,例如:"这是nailong+图片",便会自动存储到本地,开启相似度检测后,在下一次检测图片会优先识别本地已存储的图片。
|
||||
|
||||
## 📞 联系
|
||||
@ -274,6 +276,10 @@ pip install nonebot-plugin-nailongremove-base -U
|
||||
|
||||
## 📝 更新日志
|
||||
|
||||
### 小更新
|
||||
|
||||
- 增加[run_with_napcat.ipynb](https://github.com/Refound-445/nonebot-plugin-nailongremove/blob/main/ipynb/run_with_napcat.ipynb)文件,支持Kaggle或者Huggingface的Space等一键部署,仅需点击运行和扫码即可完成bot部署!
|
||||
|
||||
### 2.3.5
|
||||
|
||||
- 更新可以增加禁言标签选择功能,分别对不同种类的图片选择是否禁言或者撤回处理
|
||||
|
Loading…
Reference in New Issue
Block a user