-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 27bdab4
Showing
8 changed files
with
684 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
venv | ||
|
||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM ubuntu:22.04 | ||
|
||
RUN apt-get -o Acquire::Retries=3 update && \ | ||
apt-get -o Acquire::Retries=3 install -y --no-install-recommends git python3 python3-pip curl && \ | ||
pip install iamai[onebot] && \ | ||
pip install iamai-adapter-apscheduler && \ | ||
iamai new iamai && cd iamai | ||
|
||
COPY main.py /iamai | ||
COPY config.toml /iamai | ||
COPY docker-entrypoint.sh /iamai | ||
|
||
WORKDIR /iamai | ||
EXPOSE 3001 | ||
STOPSIGNAL SIGINT | ||
ENTRYPOINT ["bash", "docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[bot] | ||
plugin_dirs = ["plugins"] | ||
adapters = ["iamai.adapter.cqhttp"] | ||
|
||
[bot.log] | ||
level = "INFO" | ||
verbose_exception = true | ||
|
||
[adapter.cqhttp] | ||
adapter_type = "ws-reverse" | ||
host = "0.0.0.0" | ||
port = 3001 | ||
url = "/cqhttp/ws" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: "3" | ||
services: | ||
napcat: | ||
image: mlikiowa/napcat-docker:latest | ||
container_name: napcat | ||
environment: | ||
- ACCOUNT= | ||
- WSR_ENABLE=true | ||
# 如果是正向ws,将本项注释掉即可 | ||
- WS_URLS=["ws://iamai:3001/cqhttp/ws"] | ||
- NAPCAT_UID=1000 | ||
- NAPCAT_GID=1000 | ||
ports: | ||
- 6099:6099 | ||
- 3001:3001 | ||
restart: always | ||
# 如果是重新创建的容器,需要固定 Mac 地址 | ||
mac_address: 02:42:ac:11:00:99 | ||
volumes: | ||
- ./qqdata:/app/.config/QQ | ||
- ./napcat/config:/app/napcat/config | ||
- ./napcat/logs:/app/napcat/logs | ||
iamai: | ||
image: kuron/iamai-cqhttp:su | ||
container_name: iamai | ||
expose: | ||
- "3001" | ||
volumes: | ||
- ./plugins:/iamai/plugins | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
function install_from_requirements() { | ||
local dir=$1 | ||
for file in "$dir"/*; do | ||
if [ -d "$file" ]; then | ||
install_from_requirements "$file" | ||
elif [ "$file" == "$dir/requirements.txt" ]; then | ||
echo "Installing packages from $file" | ||
pip install -r "$file" | ||
fi | ||
done | ||
} | ||
|
||
install_from_requirements "plugins" | ||
|
||
python3 main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from iamai import Bot | ||
|
||
bot = Bot() | ||
|
||
if __name__ == '__main__': | ||
print(bot.config) | ||
bot.run() |
Oops, something went wrong.