-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from HenryXiaoYang/dev
v2.2.0
- Loading branch information
Showing
22 changed files
with
428 additions
and
66 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# 本文档已过期 | ||
|
||
# XYBot功能介绍 | ||
|
||
这一页介绍了所有官方XYBot微信机器人用户可使用的功能、命令。 | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# 本文档已过期 | ||
|
||
# XYBot插件编写 | ||
|
||
这一页讲述了如何编写一个XYBot插件 | ||
|
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#Version v2.0.0 | ||
bot_version: "v2.0.0" | ||
#Version v2.2.0 | ||
bot_version: "v2.2.0" | ||
|
||
# XYBot主设置 | ||
|
||
|
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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,34 @@ | ||
# Copyright (c) 2024. Henry Yang | ||
# | ||
# This program is licensed under the GNU General Public License v3.0. | ||
import os | ||
import re | ||
|
||
from loguru import logger | ||
from wcferry import client | ||
|
||
from utils.plugin_interface import PluginInterface | ||
from wcferry_helper import XYBotWxMsg | ||
|
||
|
||
class join_notification(PluginInterface): | ||
def __init__(self): | ||
self.logo_path = os.path.abspath("resources/XYBotLogo.png") | ||
|
||
async def run(self, bot: client.Wcf, recv: XYBotWxMsg): | ||
join_group_msg = recv.content | ||
|
||
# 邀请进来的 | ||
if "邀请" in join_group_msg: | ||
# 通过正则表达式提取邀请者的名字 | ||
invite_pattern = r'"([^"]+)"邀请"([^"]+)"加入了群聊' | ||
match = re.search(invite_pattern, join_group_msg) | ||
|
||
if match: | ||
joiner = match.group(2) | ||
await self.send_welcome(bot, recv.roomid, joiner) | ||
|
||
async def send_welcome(self, bot: client.Wcf, roomid: str, joiner: str): | ||
out_message = f"-------- XYBot ---------\n👏欢迎新成员 {joiner} 加入本群!⭐️\n⚙️输入 菜单 获取玩法哦😄" | ||
logger.info(f'[发送信息]{out_message}| [发送到] {roomid}') | ||
bot.send_text(out_message, roomid) |
Oops, something went wrong.