-
Notifications
You must be signed in to change notification settings - Fork 16
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 #45 from Cassius0924/improve-notifier
[Improvement] 优化收到命令提醒
- Loading branch information
Showing
7 changed files
with
33 additions
and
42 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
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 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,4 @@ | ||
from .notifier import notify_logged_in, notify_logged_out, notify_received | ||
from .sender import Sender | ||
|
||
__all__ = ["Sender"] | ||
__all__ = ["Sender", "notify_received", "notify_logged_in", "notify_logged_out"] |
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,21 @@ | ||
# 消息通知器 | ||
from wechatter.models.message import SendMessage, SendMessageType, SendTo | ||
from wechatter.sender import Sender | ||
|
||
|
||
def notify_received(to: SendTo) -> None: | ||
"""通知收到命令请求""" | ||
msg = "收到命令请求" | ||
Sender.send_msg(to, SendMessage(SendMessageType.TEXT, msg)) | ||
|
||
|
||
def notify_logged_in() -> None: | ||
"""通知登录成功""" | ||
msg = "微信机器人启动成功" | ||
Sender.send_msg_to_admins(msg) | ||
|
||
|
||
def notify_logged_out() -> None: | ||
"""通知已退出登录""" | ||
msg = "微信机器人已退出" | ||
Sender.send_msg_to_admins(msg) |