mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 15:36:44 +00:00
✨ Add Allow Bind User Invite Bot
This commit is contained in:
parent
28e0890390
commit
7ab92b630c
@ -21,6 +21,7 @@ dotenv.load_dotenv()
|
|||||||
class JoinGroups(str, Enum):
|
class JoinGroups(str, Enum):
|
||||||
NO_ALLOW = "NO_ALLOW"
|
NO_ALLOW = "NO_ALLOW"
|
||||||
ALLOW_AUTH_USER = "ALLOW_AUTH_USER"
|
ALLOW_AUTH_USER = "ALLOW_AUTH_USER"
|
||||||
|
ALLOW_USER = "ALLOW_USER"
|
||||||
ALLOW_ALL = "ALLOW_ALL"
|
ALLOW_ALL = "ALLOW_ALL"
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,6 +71,15 @@ class ChatMember(Plugin):
|
|||||||
logger.error("获取信息出现错误", exc_info=exc)
|
logger.error("获取信息出现错误", exc_info=exc)
|
||||||
else:
|
else:
|
||||||
quit_status = False
|
quit_status = False
|
||||||
|
elif config.join_groups == JoinGroups.ALLOW_USER:
|
||||||
|
try:
|
||||||
|
await self.user_service.get_user_by_id(user.id)
|
||||||
|
except UserNotFoundError:
|
||||||
|
logger.warning("用户 %s[%s] 邀请请求被拒绝", user.full_name, user.id)
|
||||||
|
except Exception as exc:
|
||||||
|
logger.error("获取信息出现错误", exc_info=exc)
|
||||||
|
else:
|
||||||
|
quit_status = False
|
||||||
elif config.join_groups == JoinGroups.ALLOW_ALL:
|
elif config.join_groups == JoinGroups.ALLOW_ALL:
|
||||||
quit_status = False
|
quit_status = False
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user