Update
This commit is contained in:
parent
03c75a6f07
commit
51762ab5ef
17 changed files with 34 additions and 34 deletions
|
@ -51,10 +51,11 @@ async def _(msg: Bot.MessageSession, friend_code: int = None):
|
||||||
get_ = await get_url(api + f'user/bests/session?user_name={query_code}', headers=headers,
|
get_ = await get_url(api + f'user/bests/session?user_name={query_code}', headers=headers,
|
||||||
fmt='json')
|
fmt='json')
|
||||||
if get_['status'] == 0:
|
if get_['status'] == 0:
|
||||||
await msg.sendMessage([Plain(msg.locale.t("arcaea.message.b30.wait")),
|
await msg.sendMessage(msg.locale.t("arcaea.message.b30.wait")),
|
||||||
Plain(msg.locale.t("arcaea.message.sb616")),
|
if msg.target.targetFrom not in ['Discord|Channel', 'Telegram|group', 'Telegram|supergroup']:
|
||||||
Image(os.path.abspath('./assets/noc.jpg')),
|
await msg.sendMessage([Plain(msg.locale.t("arcaea.message.sb616")),
|
||||||
Image(os.path.abspath('./assets/aof.jpg'))])
|
Image(os.path.abspath('./assets/noc.jpg')),
|
||||||
|
Image(os.path.abspath('./assets/aof.jpg'))])
|
||||||
elif get_['status'] == -33:
|
elif get_['status'] == -33:
|
||||||
await msg.sendMessage(msg.locale.t("arcaea.message.b30.wait.cached"))
|
await msg.sendMessage(msg.locale.t("arcaea.message.b30.wait.cached"))
|
||||||
elif get_['status'] == -23:
|
elif get_['status'] == -23:
|
||||||
|
|
|
@ -10,7 +10,7 @@ from PIL import Image, ImageDraw, ImageFont
|
||||||
from core.builtins import Bot, Image as BotImage
|
from core.builtins import Bot, Image as BotImage
|
||||||
from core.component import module
|
from core.component import module
|
||||||
|
|
||||||
c = module('color', alias=['colour'], developers=['Dianliang233',], desc='{color.help.desc}')
|
c = module('color', alias='colour', developers=['Dianliang233'], desc='{color.help.desc}')
|
||||||
|
|
||||||
font = ImageFont.truetype('assets/SourceHanSansCN-Normal.ttf', 40)
|
font = ImageFont.truetype('assets/SourceHanSansCN-Normal.ttf', 40)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ from core.component import module
|
||||||
# ureg = UnitRegistry(os.path.dirname(os.path.abspath(__file__)) +
|
# ureg = UnitRegistry(os.path.dirname(os.path.abspath(__file__)) +
|
||||||
# '/default_bi_zh-cn_en.txt', non_int_type=Decimal)
|
# '/default_bi_zh-cn_en.txt', non_int_type=Decimal)
|
||||||
ureg = UnitRegistry(non_int_type=Decimal)
|
ureg = UnitRegistry(non_int_type=Decimal)
|
||||||
i = module('convert', alias=('conv', 'unit'), desc='{convert.help.desc}',
|
i = module('convert', alias=['conv', 'unit'], desc='{convert.help.desc}',
|
||||||
developers=['Dianliang233'], support_languages=['en_us'])
|
developers=['Dianliang233'], support_languages=['en_us'])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ from core.tos import pardon_user, warn_user
|
||||||
from core.utils.cache import random_cache_path
|
from core.utils.cache import random_cache_path
|
||||||
from database import BotDBUtil
|
from database import BotDBUtil
|
||||||
|
|
||||||
su = module('superuser', alias=['su'], developers=['OasisAkari', 'Dianliang233'], required_superuser=True)
|
su = module('superuser', alias='su', developers=['OasisAkari', 'Dianliang233'], required_superuser=True)
|
||||||
|
|
||||||
|
|
||||||
@su.handle('add <user>')
|
@su.handle('add <user>')
|
||||||
|
@ -131,7 +131,7 @@ async def _(msg: Bot.MessageSession):
|
||||||
await msg.finish(msg.locale.t("core.message.set.help.option.tion.tion.tion.tion.tion.success", k=k, v=v))
|
await msg.finish(msg.locale.t("core.message.set.help.option.tion.tion.tion.tion.tion.success", k=k, v=v))
|
||||||
|
|
||||||
|
|
||||||
ae = module('abuse', alias=['ae'], developers=['Dianliang233'], required_superuser=True)
|
ae = module('abuse', alias='ae', developers=['Dianliang233'], required_superuser=True)
|
||||||
|
|
||||||
|
|
||||||
@ae.handle('check <user>')
|
@ae.handle('check <user>')
|
||||||
|
|
|
@ -206,8 +206,7 @@ leave = module(
|
||||||
base=True,
|
base=True,
|
||||||
required_admin=True,
|
required_admin=True,
|
||||||
available_for='QQ|Group',
|
available_for='QQ|Group',
|
||||||
alias={
|
alias='dismiss',
|
||||||
'dismiss': 'leave'},
|
|
||||||
desc='{core.help.leave}')
|
desc='{core.help.leave}')
|
||||||
|
|
||||||
|
|
||||||
|
@ -219,7 +218,7 @@ async def _(msg: Bot.MessageSession):
|
||||||
await msg.call_api('set_group_leave', group_id=msg.session.target)
|
await msg.call_api('set_group_leave', group_id=msg.session.target)
|
||||||
|
|
||||||
|
|
||||||
petal = module('petal', developers=['Dianliang233'], base=True, alias={'petals': 'petal'},
|
petal = module('petal', developers=['Dianliang233'], base=True, alias='petals',
|
||||||
desc='{core.help.petal}')
|
desc='{core.help.petal}')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ from core.component import module
|
||||||
from .screenshot import get_pic
|
from .screenshot import get_pic
|
||||||
|
|
||||||
|
|
||||||
dict_module = module('dictionary', alias=["dict"],
|
dict_module = module('dictionary', alias="dict",
|
||||||
desc='{dictionary.help.desc}', developers=['Dianliang233'], support_languages=['en_us'])
|
desc='{dictionary.help.desc}', developers=['Dianliang233'], support_languages=['en_us'])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,7 @@ api_key = Config('exchange_rate_api_key')
|
||||||
|
|
||||||
excr = module('exchange_rate',
|
excr = module('exchange_rate',
|
||||||
desc='{exchange_rate.help.desc}',
|
desc='{exchange_rate.help.desc}',
|
||||||
alias={'exchangerate': 'exchange_rate',
|
alias=['exchangerate', 'excr'],
|
||||||
'excr': 'exchange_rate'},
|
|
||||||
developers=['DoroWolf'])
|
developers=['DoroWolf'])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ from core.builtins import Bot
|
||||||
from core.component import module
|
from core.component import module
|
||||||
from modules.github import repo, user, search
|
from modules.github import repo, user, search
|
||||||
|
|
||||||
github = module('github', alias=['gh'], developers=['Dianliang233'])
|
github = module('github', alias='gh', developers=['Dianliang233'])
|
||||||
|
|
||||||
|
|
||||||
@github.handle('<name> {{github.help}}')
|
@github.handle('<name> {{github.help}}')
|
||||||
|
|
|
@ -6,11 +6,9 @@ hitokoto_types = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"]
|
||||||
|
|
||||||
hitokoto = module(
|
hitokoto = module(
|
||||||
'hitokoto',
|
'hitokoto',
|
||||||
developers=[
|
developers=['bugungu','DoroWolf'],
|
||||||
'bugungu',
|
|
||||||
'DoroWolf'],
|
|
||||||
desc='{hitokoto.help.desc}',
|
desc='{hitokoto.help.desc}',
|
||||||
alias=['htkt'],
|
alias='htkt',
|
||||||
support_languages=['zh_cn'])
|
support_languages=['zh_cn'])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,8 @@ from modules.maimai.libraries.tool import hash_
|
||||||
|
|
||||||
total_list = TotalList()
|
total_list = TotalList()
|
||||||
|
|
||||||
diff_label = ['Basic', 'Advanced', 'Expert', 'Master', 'Re:MASTER']
|
diff_label = ['basic', 'advanced', 'expert', 'master', 're:master']
|
||||||
|
diff_label_abbr = ['bas', 'adv', 'exp', 'mas', 'rem']
|
||||||
diff_label_zhs = ['绿', '黄', '红', '紫', '白']
|
diff_label_zhs = ['绿', '黄', '红', '紫', '白']
|
||||||
diff_label_zht = ['綠', '黃', '紅']
|
diff_label_zht = ['綠', '黃', '紅']
|
||||||
|
|
||||||
|
@ -23,10 +24,13 @@ def song_txt(music: Music):
|
||||||
|
|
||||||
|
|
||||||
def get_label(diff):
|
def get_label(diff):
|
||||||
|
diff = diff.lower()
|
||||||
if diff in diff_label_zhs:
|
if diff in diff_label_zhs:
|
||||||
level = diff_label_zhs.index(diff)
|
level = diff_label_zhs.index(diff)
|
||||||
elif diff in diff_label_zht:
|
elif diff in diff_label_zht:
|
||||||
level = diff_label_zht.index(diff)
|
level = diff_label_zht.index(diff)
|
||||||
|
elif diff in diff_label_abbr:
|
||||||
|
level = diff_label_abbr.index(diff)
|
||||||
elif diff in diff_label:
|
elif diff in diff_label:
|
||||||
level = diff_label.index(diff)
|
level = diff_label.index(diff)
|
||||||
else:
|
else:
|
||||||
|
@ -34,8 +38,8 @@ def get_label(diff):
|
||||||
return level
|
return level
|
||||||
|
|
||||||
|
|
||||||
mai = module('maimai', developers=['mai-bot', 'OasisAkari', 'DoroWolf'], alias=['mai'],
|
mai = module('maimai', developers=['mai-bot', 'OasisAkari', 'DoroWolf'], alias='mai',
|
||||||
desc='{maimai.help.desc}', support_languages=['zh_cn'])
|
desc='{maimai.help.desc}')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,7 +215,7 @@ async def _(message: Bot.MessageSession):
|
||||||
Plain(message.locale.t("maimai.message.song",
|
Plain(message.locale.t("maimai.message.song",
|
||||||
artist=music['basic_info']['artist'], genre=music['basic_info']['genre'],
|
artist=music['basic_info']['artist'], genre=music['basic_info']['genre'],
|
||||||
bpm=music['basic_info']['bpm'], version=music['basic_info']['from'],
|
bpm=music['basic_info']['bpm'], version=music['basic_info']['from'],
|
||||||
level='/'.join(music['level'])))])
|
level='/'.join(music['ds'])))])
|
||||||
except Exception:
|
except Exception:
|
||||||
await message.finish(message.locale.t("maimai.message.music_not_found"))
|
await message.finish(message.locale.t("maimai.message.music_not_found"))
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
"maimai.message.no_username": "请提供用户名!",
|
"maimai.message.no_username": "请提供用户名!",
|
||||||
"maimai.message.search": "“${keyword}”的搜索结果:",
|
"maimai.message.search": "“${keyword}”的搜索结果:",
|
||||||
"maimai.message.song": "艺术家:${artist}\n分类:${genre}\nBPM:${bpm}\n版本:${version}\n难度:${level}",
|
"maimai.message.song": "艺术家:${artist}\n分类:${genre}\nBPM:${bpm}\n版本:${version}\n难度:${level}",
|
||||||
"maimai.message.song.dx": "${diff} ${level} (${ds})\nTAP:${tap}\nHOLD:${hold}\nSLIDE:${slide}\nTOUCH:${touch}\nBREAK:${_break}\n谱师:${charter}",
|
"maimai.message.song.dx": "${diff} ${level}(${ds})\nTAP:${tap}\nHOLD:${hold}\nSLIDE:${slide}\nTOUCH:${touch}\nBREAK:${_break}\n谱师:${charter}",
|
||||||
"maimai.message.song.sd": "${diff} ${level} (${ds})\nTAP:${tap}\nHOLD:${hold}\nSLIDE:${slide}\nBREAK:${_break}\n谱师:${charter}",
|
"maimai.message.song.sd": "${diff} ${level}(${ds})\nTAP:${tap}\nHOLD:${hold}\nSLIDE:${slide}\nBREAK:${_break}\n谱师:${charter}",
|
||||||
"maimai.message.too_much": "结果过多(${length} 条),请缩小搜索范围。",
|
"maimai.message.too_much": "结果过多(${length} 条),请缩小搜索范围。",
|
||||||
"maimai.message.user_not_found": "未找到此玩家,请确保此玩家的用户名和查分器中的用户名相同。"
|
"maimai.message.user_not_found": "未找到此玩家,请确保此玩家的用户名和查分器中的用户名相同。"
|
||||||
}
|
}
|
|
@ -16,8 +16,8 @@
|
||||||
"maimai.message.no_username": "请提供用户名!",
|
"maimai.message.no_username": "请提供用户名!",
|
||||||
"maimai.message.search": "“${keyword}”的搜索结果:",
|
"maimai.message.search": "“${keyword}”的搜索结果:",
|
||||||
"maimai.message.song": "艺术家:${artist}\n分类:${genre}\nBPM:${bpm}\n版本:${version}\n难度:${level}",
|
"maimai.message.song": "艺术家:${artist}\n分类:${genre}\nBPM:${bpm}\n版本:${version}\n难度:${level}",
|
||||||
"maimai.message.song.dx": "${diff} ${level} (${ds})\nTAP:${tap}\nHOLD:${hold}\nSLIDE:${slide}\nTOUCH:${touch}\nBREAK:${_break}\n谱师:${charter}",
|
"maimai.message.song.dx": "${diff} ${level}(${ds})\nTAP:${tap}\nHOLD:${hold}\nSLIDE:${slide}\nTOUCH:${touch}\nBREAK:${_break}\n谱师:${charter}",
|
||||||
"maimai.message.song.sd": "${diff} ${level} (${ds})\nTAP:${tap}\nHOLD:${hold}\nSLIDE:${slide}\nBREAK:${_break}\n谱师:${charter}",
|
"maimai.message.song.sd": "${diff} ${level}(${ds})\nTAP:${tap}\nHOLD:${hold}\nSLIDE:${slide}\nBREAK:${_break}\n谱师:${charter}",
|
||||||
"maimai.message.too_much": "结果过多(${length} 条),请缩小搜索范围。",
|
"maimai.message.too_much": "结果过多(${length} 条),请缩小搜索范围。",
|
||||||
"maimai.message.user_not_found": "未找到此玩家,请确保此玩家的用户名和查分器中的用户名相同。"
|
"maimai.message.user_not_found": "未找到此玩家,请确保此玩家的用户名和查分器中的用户名相同。"
|
||||||
}
|
}
|
|
@ -16,8 +16,8 @@
|
||||||
"maimai.message.no_username": "請提供使用者名稱!",
|
"maimai.message.no_username": "請提供使用者名稱!",
|
||||||
"maimai.message.search": "「${keyword}」的搜尋結果:",
|
"maimai.message.search": "「${keyword}」的搜尋結果:",
|
||||||
"maimai.message.song": "藝術家:${artist}\n分類:${genre}\nBPM:${bpm}\n版本:${version}\n難度:${level}",
|
"maimai.message.song": "藝術家:${artist}\n分類:${genre}\nBPM:${bpm}\n版本:${version}\n難度:${level}",
|
||||||
"maimai.message.song.dx": "${diff} ${level} (${ds})\nTAP:${tap}\nHOLD:${hold}\nSLIDE:${slide}\nTOUCH:${touch}\nBREAK:${_break}\n譜師:${charter}",
|
"maimai.message.song.dx": "${diff} ${level}(${ds})\nTAP:${tap}\nHOLD:${hold}\nSLIDE:${slide}\nTOUCH:${touch}\nBREAK:${_break}\n譜師:${charter}",
|
||||||
"maimai.message.song.sd": "${diff} ${level} (${ds})\nTAP:${tap}\nHOLD:${hold}\nSLIDE:${slide}\nBREAK:${_break}\n譜師:${charter}",
|
"maimai.message.song.sd": "${diff} ${level}(${ds})\nTAP:${tap}\nHOLD:${hold}\nSLIDE:${slide}\nBREAK:${_break}\n譜師:${charter}",
|
||||||
"maimai.message.too_much": "結果過多(${length} 條),請縮小搜尋範圍。",
|
"maimai.message.too_much": "結果過多(${length} 條),請縮小搜尋範圍。",
|
||||||
"maimai.message.user_not_found": "未找到此使用者,請確認此使用者的名稱和查分器中的名稱相同。"
|
"maimai.message.user_not_found": "未找到此使用者,請確認此使用者的名稱和查分器中的名稱相同。"
|
||||||
}
|
}
|
|
@ -9,7 +9,7 @@ from modules.meme.urban import urban
|
||||||
meme = module(
|
meme = module(
|
||||||
bind_prefix='meme',
|
bind_prefix='meme',
|
||||||
# well, people still use it though it only lived for an hour or so
|
# well, people still use it though it only lived for an hour or so
|
||||||
alias=['nbnhhsh'],
|
alias='nbnhhsh',
|
||||||
desc='{meme.help.desc}',
|
desc='{meme.help.desc}',
|
||||||
developers=['Dianliang233'],
|
developers=['Dianliang233'],
|
||||||
support_languages=['zh_cn', 'en_us'])
|
support_languages=['zh_cn', 'en_us'])
|
||||||
|
|
|
@ -4,7 +4,7 @@ from config import Config
|
||||||
from core.builtins import Bot
|
from core.builtins import Bot
|
||||||
from core.component import module
|
from core.component import module
|
||||||
|
|
||||||
n = module('natural', alias=['nl2c'], developers=['Dianliang233'], desc='{natural.help}', required_superuser=True)
|
n = module('natural', alias='nl2c', developers=['Dianliang233'], desc='{natural.help}', required_superuser=True)
|
||||||
|
|
||||||
# Load your API key from an environment variable or secret management service
|
# Load your API key from an environment variable or secret management service
|
||||||
openai.api_key = Config('openai_api_key')
|
openai.api_key = Config('openai_api_key')
|
||||||
|
|
|
@ -5,7 +5,7 @@ from core.component import module
|
||||||
from modules.wiki.utils.dbutils import WikiTargetInfo
|
from modules.wiki.utils.dbutils import WikiTargetInfo
|
||||||
from .user import get_user_info
|
from .user import get_user_info
|
||||||
|
|
||||||
usr = module('user', alias=['u'],
|
usr = module('user', alias='u',
|
||||||
developers=['OasisAkari'])
|
developers=['OasisAkari'])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,7 @@ client = wolframalpha.Client(Config('wolfram_alpha_appid'))
|
||||||
|
|
||||||
w = module(
|
w = module(
|
||||||
'wolframalpha',
|
'wolframalpha',
|
||||||
alias={
|
alias='wolfram',
|
||||||
'wolfram': 'wolframalpha'},
|
|
||||||
developers=['Dianliang233'],
|
developers=['Dianliang233'],
|
||||||
desc='{wolframalpha.help.desc}',
|
desc='{wolframalpha.help.desc}',
|
||||||
support_languages=['en_us'])
|
support_languages=['en_us'])
|
||||||
|
|
Reference in a new issue