Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改禁言API设置timeout的方式 #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dao/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, host, db, user, password, port=3306):
:param port:数据库端口
:param db:库名
:param user:用户名
:param passwd:密码
:param password:密码
:param charset:字符编码
"""
self.host = host
Expand Down
10 changes: 4 additions & 6 deletions flow/operate.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
from datetime import datetime, date, timedelta

from constant import config

import qqbot
from qqbot.model.mute import MuteOption

from constant import config

APPID = config["token"]["appid"]
TOKEN = config["token"]["token"]
GUILD_ID = config["params"]["guildId"]


async def mute_all():
mute_api = qqbot.AsyncMuteAPI(qqbot.Token(APPID, TOKEN), False).with_timeout(5)
mute_api = qqbot.AsyncMuteAPI(qqbot.Token(APPID, TOKEN), False, timeout=5)
await mute_api.mute_all(GUILD_ID, MuteOption(mute_seconds=str(8 * 3600)))


async def end_mute_all():
mute_api = qqbot.AsyncMuteAPI(qqbot.Token(APPID, TOKEN), False).with_timeout(5)
mute_api = qqbot.AsyncMuteAPI(qqbot.Token(APPID, TOKEN), False, timeout=5)
await mute_api.mute_all(GUILD_ID, MuteOption(mute_seconds='0'))