mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-07 20:33:01 +08:00
add @staticmethod for util class
This commit is contained in:
parent
8d6d5c9e8b
commit
05ec0659d1
@ -70,10 +70,9 @@ from nonebot.adapters.onebot.v11.event import Sender
|
|||||||
fake_admin_user = Sender(nickname="test", role="admin")
|
fake_admin_user = Sender(nickname="test", role="admin")
|
||||||
fake_superuser = Sender(user_id=10001, nickname="superuser")
|
fake_superuser = Sender(user_id=10001, nickname="superuser")
|
||||||
|
|
||||||
from nonebot.adapters.onebot.v11.message import Message, MessageSegment
|
|
||||||
|
|
||||||
|
|
||||||
class BotReply:
|
class BotReply:
|
||||||
|
@staticmethod
|
||||||
def add_reply_on_platform(platform_manager, common_platform):
|
def add_reply_on_platform(platform_manager, common_platform):
|
||||||
return (
|
return (
|
||||||
"请输入想要订阅的平台,目前支持,请输入冒号左边的名称:\n"
|
"请输入想要订阅的平台,目前支持,请输入冒号左边的名称:\n"
|
||||||
@ -88,6 +87,7 @@ class BotReply:
|
|||||||
+ "要查看全部平台请输入:“全部”\n中止订阅过程请输入:“取消”"
|
+ "要查看全部平台请输入:“全部”\n中止订阅过程请输入:“取消”"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
def add_reply_on_platform_input_allplatform(platform_manager):
|
def add_reply_on_platform_input_allplatform(platform_manager):
|
||||||
return "全部平台\n" + "\n".join(
|
return "全部平台\n" + "\n".join(
|
||||||
[
|
[
|
||||||
@ -96,6 +96,7 @@ class BotReply:
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
def add_reply_on_id_input_search():
|
def add_reply_on_id_input_search():
|
||||||
search_url = "https://nonebot-bison.vercel.app/usage/#%E6%89%80%E6%94%AF%E6%8C%81%E5%B9%B3%E5%8F%B0%E7%9A%84-uid"
|
search_url = "https://nonebot-bison.vercel.app/usage/#%E6%89%80%E6%94%AF%E6%8C%81%E5%B9%B3%E5%8F%B0%E7%9A%84-uid"
|
||||||
search_title = "Bison所支持的平台UID"
|
search_title = "Bison所支持的平台UID"
|
||||||
@ -111,17 +112,21 @@ class BotReply:
|
|||||||
msg = [type, data]
|
msg = [type, data]
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
def add_reply_on_target_confirm(platform, name, id):
|
def add_reply_on_target_confirm(platform, name, id):
|
||||||
return f"即将订阅的用户为:{platform} {name} {id}\n如有错误请输入“取消”重新订阅"
|
return f"即将订阅的用户为:{platform} {name} {id}\n如有错误请输入“取消”重新订阅"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
def add_reply_on_cats(platform_manager, platform: str):
|
def add_reply_on_cats(platform_manager, platform: str):
|
||||||
return "请输入要订阅的类别,以空格分隔,支持的类别有:{}".format(
|
return "请输入要订阅的类别,以空格分隔,支持的类别有:{}".format(
|
||||||
" ".join(list(platform_manager[platform].categories.values()))
|
" ".join(list(platform_manager[platform].categories.values()))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
def add_reply_on_cats_input_error(cat: str):
|
def add_reply_on_cats_input_error(cat: str):
|
||||||
return "不支持 {}".format(cat)
|
return "不支持 {}".format(cat)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
def add_reply_subscribe_success(name):
|
def add_reply_subscribe_success(name):
|
||||||
return "添加 {} 成功".format(name)
|
return "添加 {} 成功".format(name)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user