Archived
1
0
Fork 0

Update wiki

This commit is contained in:
多羅狼 2024-01-03 01:48:49 +08:00 committed by GitHub
parent 81d00eeb31
commit 0700ce9181
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 12 deletions

View file

@ -9,7 +9,7 @@ from modules.wiki import WikiLib, WikiTargetInfo
@client.slash_command(description="Get recent abuse logs for the default wiki.")
async def ab(ctx: discord.ApplicationContext):
await slash_parser(ctx, "legacy")
await slash_parser(ctx, "")
@client.slash_command(description="Get recent newbie logs for the default wiki.")
@ -19,7 +19,7 @@ async def newbie(ctx: discord.ApplicationContext):
@client.slash_command(description="Get recent changes for the default wiki.")
async def rc(ctx: discord.ApplicationContext):
await slash_parser(ctx, "legacy")
await slash_parser(ctx, "")
wiki = client.create_group("wiki", "Query information from Mediawiki-based websites.")

View file

@ -15,7 +15,7 @@
"wiki.help.iw.list": "Lists the currently configured Interwiki.",
"wiki.help.iw.list.legacy": "Lists the currently configured Interwiki. (Legacy)",
"wiki.help.iw.remove": "Remove custom Interwiki.",
"wiki.help.newbie.desc": "Get recent newbie logs for the default wiki.",
"wiki.help.newbie": "Get recent newbie logs for the default wiki.",
"wiki.help.option.l": "Find the corresponding language version of this page, and return the current language if no result.",
"wiki.help.prefix.reset": "Reset custom wiki prefix.",
"wiki.help.prefix.set": "Set custom wiki prefix.",

View file

@ -15,7 +15,7 @@
"wiki.help.iw.list": "列出当前设置的 Interwiki。",
"wiki.help.iw.list.legacy": "列出当前设置的 Interwiki。旧版",
"wiki.help.iw.remove": "删除自定义 Interwiki。",
"wiki.help.newbie.desc": "获取默认 Wiki 的新用户日志。",
"wiki.help.newbie": "获取默认 Wiki 的新用户日志。",
"wiki.help.option.l": "查找本页面的对应语言版本,若无结果则返回当前语言。",
"wiki.help.prefix.reset": "重置自定义前缀。",
"wiki.help.prefix.set": "设置自定义前缀。",

View file

@ -15,7 +15,7 @@
"wiki.help.iw.list": "列出目前設定的 Interwiki。",
"wiki.help.iw.list.legacy": "列出目前設定的 Interwiki。舊版",
"wiki.help.iw.remove": "刪除自訂 Interwiki。",
"wiki.help.newbie.desc": "取得預設 Wiki 的最新使用者日誌。",
"wiki.help.newbie": "取得預設 Wiki 的最新使用者日誌。",
"wiki.help.option.l": "查找本頁面的對應語言版本,若無結果則返回目前語言。",
"wiki.help.prefix.reset": "重設自訂前綴。",
"wiki.help.prefix.set": "設定自訂前綴。",

View file

@ -13,12 +13,13 @@ from .rc_qq import rc_qq
rc_ = module('rc', developers=['OasisAkari'])
@rc_.command([ '[<count>] {{wiki.help.rc}}',
'legacy [<count>] {{wiki.help.rc.legacy}}'])
@rc_.command(['{{wiki.help.rc}}',
'legacy [<count>] {{wiki.help.rc.legacy}}'],
available_for=['QQ', 'QQ|Group'])
async def rc_loader(msg: Bot.MessageSession, count: int=5):
start_wiki = WikiTargetInfo(msg).get_start_wiki()
if not start_wiki:
return await msg.finish(msg.locale.t('wiki.message.not_set'))
await msg.finish(msg.locale.t('wiki.message.not_set'))
legacy = True
if not msg.parsed_msg and msg.Feature.forward and msg.target.target_from == 'QQ|Group':
try:
@ -33,15 +34,26 @@ async def rc_loader(msg: Bot.MessageSession, count: int=5):
await msg.finish(res)
@rc_.command(['[<count>] {{wiki.help.rc}}'],
exclude_from=['QQ', 'QQ|Group'])
async def rc_loader(msg: Bot.MessageSession, count: int=5):
start_wiki = WikiTargetInfo(msg).get_start_wiki()
if not start_wiki:
await msg.finish(msg.locale.t('wiki.message.not_set'))
res = await rc(msg, start_wiki, count)
await msg.finish(res)
a = module('ab', developers=['OasisAkari'])
@a.command(['[<count>] {{wiki.help.ab}}',
'legacy [<count>] {{wiki.help.ab.legacy}}'])
@a.command(['{{wiki.help.ab}}',
'legacy [<count>] {{wiki.help.ab.legacy}}'],
available_for=['QQ', 'QQ|Group'])
async def ab_loader(msg: Bot.MessageSession, count: int=5):
start_wiki = WikiTargetInfo(msg).get_start_wiki()
if not start_wiki:
return await msg.finish(msg.locale.t('wiki.message.not_set'))
await msg.finish(msg.locale.t('wiki.message.not_set'))
legacy = True
if not msg.parsed_msg and msg.Feature.forward and msg.target.target_from == 'QQ|Group':
try:
@ -56,6 +68,16 @@ async def ab_loader(msg: Bot.MessageSession, count: int=5):
await msg.finish(res)
@a.command(['[<count>] {{wiki.help.ab}}'],
exclude_from=['QQ', 'QQ|Group'])
async def ab_loader(msg: Bot.MessageSession, count: int=5):
start_wiki = WikiTargetInfo(msg).get_start_wiki()
if not start_wiki:
await msg.finish(msg.locale.t('wiki.message.not_set'))
res = await ab(msg, start_wiki, count)
await msg.finish(res)
n = module('newbie', developers=['OasisAkari'])
@ -63,6 +85,6 @@ n = module('newbie', developers=['OasisAkari'])
async def newbie_loader(msg: Bot.MessageSession, count: int=5):
start_wiki = WikiTargetInfo(msg).get_start_wiki()
if not start_wiki:
return await msg.finish(msg.locale.t('wiki.message.not_set'))
await msg.finish(msg.locale.t('wiki.message.not_set'))
res = await newbie(msg, start_wiki, count)
await msg.finish(res)