Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
sudoskys committed Jan 8, 2023
2 parents adad296 + d3b26ef commit b565114
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 111 deletions.
18 changes: 9 additions & 9 deletions App/Event.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,17 +565,17 @@ async def Friends(Message: User_Message, config) -> PublicReturn:
reply="Error Occur~Maybe Api request rate limit~nya")


async def Tigger(Message: User_Message, config) -> PublicReturn:
async def Trigger(Message: User_Message, config) -> PublicReturn:
"""
:param Message: group id
:param config:
:return: TRUE,msg -> 在白名单
"""
group_id = Message.from_chat.id
if config.tigger:
if GroupManger(group_id).read("tigger"):
if config.trigger:
if GroupManger(group_id).read("trigger"):
return PublicReturn(status=True, trace="WhiteUserCheck")
return PublicReturn(status=False, trace="No tigger")
return PublicReturn(status=False, trace="No trigger")


async def GroupAdminCommand(Message: User_Message, config, pLock):
Expand All @@ -584,13 +584,13 @@ async def GroupAdminCommand(Message: User_Message, config, pLock):
group_id = Message.from_chat.id
try:
command = Message.text
if command.startswith("/tigger"):
if command.startswith("/trigger"):
_group_manger = GroupManger(int(group_id))
_set = True
if _group_manger.read("tigger"):
if _group_manger.read("trigger"):
_set = False
_group_manger.save({"tigger": _set})
_ev = f"Group Admin:GroupTigger {_set}"
_group_manger.save({"trigger": _set})
_ev = f"Group Admin:GroupTrigger {_set}"
_reply.append(_ev)
logger.info(_ev)
#
Expand Down Expand Up @@ -874,5 +874,5 @@ async def Help(_):
Use /remind 设置一个场景头,全程不会被裁剪。
Use /forgetme 遗忘过去,res history。
Use /voice 开启可能的 tts 支持。
Use /tigger Admin 可以开启主动回复模式。
Use /trigger Admin 可以开启主动回复模式。
"""
10 changes: 5 additions & 5 deletions App/QQ.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ async def group_chat(app: Ariadne,

# 热力扳机
if not started:
_tigger_message = await Event.Tigger(_hand, self.config)
if _tigger_message.status:
_GroupTigger = Vitality(group_id=_hand.from_chat.id)
_GroupTigger.tigger(Message=_hand, config=self.config)
_check = _GroupTigger.check(Message=_hand)
_trigger_message = await Event.Trigger(_hand, self.config)
if _trigger_message.status:
_GroupTrigger = Vitality(group_id=_hand.from_chat.id)
_GroupTrigger.trigger(Message=_hand, config=self.config)
_check = _GroupTrigger.check(Message=_hand)
if _check:
_hand.text = f"/catch {_hand.text}"
started = True
Expand Down
10 changes: 5 additions & 5 deletions App/Telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ async def group_msg(message):

# 热力扳机
if not started:
_tigger_message = await Event.Tigger(_hand, _config)
if _tigger_message.status:
_GroupTigger = Vitality(group_id=_hand.from_chat.id)
_GroupTigger.tigger(Message=_hand, config=_config)
_check = _GroupTigger.check(Message=_hand)
_trigger_message = await Event.Trigger(_hand, _config)
if _trigger_message.status:
_GroupTrigger = Vitality(group_id=_hand.from_chat.id)
_GroupTrigger.trigger(Message=_hand, config=_config)
_check = _GroupTrigger.check(Message=_hand)
if _check:
_hand.text = f"/catch {_hand.text}"
started = True
Expand Down
6 changes: 3 additions & 3 deletions Config/app_exp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ account = 0
http_host = 'localhost:8080' # Mirai http服务器
ws_host = 'localhost:8080' # Mirai Websocket服务器
verify_key = ""
tigger = false
trigger = false
INTRO = "POWER BY OPENAI" # 后缀
ABOUT = "Created by github.com/sudoskys/Openaibot" # 关于命令返回
WHITE = "Group NOT in WHITE list" # 黑白名单提示
Expand All @@ -16,7 +16,7 @@ WHITE = "Group NOT in WHITE list" # 黑白名单提示
[Controller.Telegram]
master = [114, 514] # master user id , 账号 ID
botToken = '' # 机器人密钥
tigger = false
trigger = false
INTRO = "POWER BY OPENAI" # 后缀
ABOUT = "Created by github.com/sudoskys/Openaibot" # 关于命令返回
WHITE = "Group NOT in WHITE list" # 黑白名单提示
Expand All @@ -25,4 +25,4 @@ proxy = { status = false, url = "http://127.0.0.1:7890" }

# Base Event Api
# [Controller.BaseServer]
# port = 9559
# port = 9559
80 changes: 40 additions & 40 deletions README.EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ account = 0
http_host = 'localhost:8080' # Mirai http服务器
ws_host = 'localhost:8080' # Mirai Websocket服务器
verify_key = ""
tigger = false # 合适的时候主动回复
trigger = false # 合适的时候主动回复
INTRO = "POWER BY OPENAI" # 后缀
ABOUT = "Created by github.com/sudoskys/Openaibot" # 关于命令返回
WHITE = "Group NOT in WHITE list" # 黑白名单提示
Expand All @@ -156,7 +156,7 @@ WHITE = "Group NOT in WHITE list" # 黑白名单提示
[Controller.Telegram]
master = [114, 514] # master user id , 账号 ID
botToken = '' # 机器人密钥
tigger = false # 合适的时候主动回复
trigger = false # 合适的时候主动回复
INTRO = "POWER BY OPENAI" # 后缀
ABOUT = "Created by github.com/sudoskys/Openaibot" # 关于命令返回
WHITE = "Group NOT in WHITE list" # 黑白名单提示
Expand Down Expand Up @@ -333,44 +333,44 @@ kill -9

Restricted class setting set to ``1`` means no effect.

| command | function | extra |
|-------------------------------------------|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| `/set_user_cold` | set user cooldown time | can not send within the time 1 is unlimited |
| `/set_group_cold` | Set group cooling time | Cannot send within the time 1 is unlimited |
| `/set_token_limit` | Set the output limit length | Api's 4095 limit is input + output, if it exceeds the limit, please reduce the output |
| `/set_input_limit` | Set input limit length | |
| `/config` | get/backup config.json file | send file |
| `/add_block_group` +id absolute value | Prohibited | Effective directly Can be followed by multiple parameters, separated by spaces |
| `/del_block_group` + absolute value of id | Unban | Effective directly Can be separated with multiple parameters and spaces |
| `/add_block_user` +Absolute value of id | Forbidden | Effective directly Can be followed by multiple parameters, separated by spaces |
| `/del_block_user` + absolute value of id | Unban | Effective directly Can be separated with multiple parameters and spaces |
| `/add_white_group` +id absolute value | Add | Need to enable the whitelist mode to take effect Can be separated with multiple parameters and spaces |
| `/add_white_user` + id absolute value | Add | Need to enable the whitelist mode to take effect Can be separated with multiple parameters and spaces |
| `/del_white_group` +id absolute value | Delisting | Need to enable the whitelist mode to take effect Can be separated with multiple parameters and spaces |
| `/del_white_user` + absolute value of id | Delisting | Need to enable the whitelist mode to take effect Can be separated with multiple parameters and spaces |
| `/update_detect` | Update sensitive words | |
| `/open_user_white_mode` | Open user whitelist | |
| `/open_group_white_mode` | Open group whitelist | |
| `/close_user_white_mode` | close user whitelist | |
| `/close_group_white_mode` | close group whitelist | |
| `/open` | Open the robot | |
| `/close` | close the robot | |
| command | function | extra |
| ----------------------------------------- | --------------------------- | ------------------------------------------------------------ |
| `/set_user_cold` | set user cooldown time | can not send within the time 1 is unlimited |
| `/set_group_cold` | Set group cooling time | Cannot send within the time 1 is unlimited |
| `/set_token_limit` | Set the output limit length | Api's 4095 limit is input + output, if it exceeds the limit, please reduce the output |
| `/set_input_limit` | Set input limit length | |
| `/config` | get/backup config.json file | send file |
| `/add_block_group` +id absolute value | Prohibited | Effective directly Can be followed by multiple parameters, separated by spaces |
| `/del_block_group` + absolute value of id | Unban | Effective directly Can be separated with multiple parameters and spaces |
| `/add_block_user` +Absolute value of id | Forbidden | Effective directly Can be followed by multiple parameters, separated by spaces |
| `/del_block_user` + absolute value of id | Unban | Effective directly Can be separated with multiple parameters and spaces |
| `/add_white_group` +id absolute value | Add | Need to enable the whitelist mode to take effect Can be separated with multiple parameters and spaces |
| `/add_white_user` + id absolute value | Add | Need to enable the whitelist mode to take effect Can be separated with multiple parameters and spaces |
| `/del_white_group` +id absolute value | Delisting | Need to enable the whitelist mode to take effect Can be separated with multiple parameters and spaces |
| `/del_white_user` + absolute value of id | Delisting | Need to enable the whitelist mode to take effect Can be separated with multiple parameters and spaces |
| `/update_detect` | Update sensitive words | |
| `/open_user_white_mode` | Open user whitelist | |
| `/open_group_white_mode` | Open group whitelist | |
| `/close_user_white_mode` | close user whitelist | |
| `/close_group_white_mode` | close group whitelist | |
| `/open` | Open the robot | |
| `/close` | close the robot | |
| `/chat` | Conversation | Each time /chat starts over, forgetting the record. Replies cannot be indexed after 24 hours in the group, and private chats are permanent. |
| `/write` | continue writing | continue writing. |
| `/see_api_key` | Several Api keys now | |
| `/remind` | Persona | Fixed reminder. |
| `/del_api_key` +key | Delete Api key | Can follow multiple parameters, separated by spaces |
| `/add_api_key` +key | Add Api key | Can follow multiple parameters, separated by spaces |
| `/set_per_user_limit` | total user allocation limit | 1 is unlimited per user |
| `/set_per_hour_limit` | user hour usage | 1 is unlimited, per user |
| `/reset_user_usage`+userID | Reset user quota | Measured by user Can be followed by multiple parameters, separated by spaces |
| `/promote_user_limit`+userID+limit | Promote the user's limit | Measured by user 1 is the default, can be followed by multiple parameters, separated by spaces |
| `/disable_change_head` | disalbe head setting | Setting again will reset to empty |
| `/enable_change_head` | enable head setting | |
| `/remind` | how ai perform self | Fixed cue words |
| `/forgetme` | 忘记我 | |
| `/voice` | VITS/AZURE TTS | |
| `/tigger` | Active reply mode | Global settings or/and only admin group members can activate this group mode |
| `/write` | continue writing | continue writing. |
| `/see_api_key` | Several Api keys now | |
| `/remind` | Persona | Fixed reminder. |
| `/del_api_key` +key | Delete Api key | Can follow multiple parameters, separated by spaces |
| `/add_api_key` +key | Add Api key | Can follow multiple parameters, separated by spaces |
| `/set_per_user_limit` | total user allocation limit | 1 is unlimited per user |
| `/set_per_hour_limit` | user hour usage | 1 is unlimited, per user |
| `/reset_user_usage`+userID | Reset user quota | Measured by user Can be followed by multiple parameters, separated by spaces |
| `/promote_user_limit`+userID+limit | Promote the user's limit | Measured by user 1 is the default, can be followed by multiple parameters, separated by spaces |
| `/disable_change_head` | disalbe head setting | Setting again will reset to empty |
| `/enable_change_head` | enable head setting | |
| `/remind` | how ai perform self | Fixed cue words |
| `/forgetme` | 忘记我 | |
| `/voice` | VITS/AZURE TTS | |
| `/trigger` | Active reply mode | Global settings or/and only admin group members can activate this group mode |

### Sample table

Expand All @@ -380,7 +380,7 @@ write - complement
remind - persona
forgetme - reset
voice - talk to me
tigger - AdminCommand Active reply mode
trigger - AdminCommand Active reply mode
set_user_cold - set user cooldown
set_group_cold - sets the group cooldown time
set_token_limit - set output limit length
Expand Down
Loading

0 comments on commit b565114

Please sign in to comment.