1,554
个编辑
(使用 random.main("array",{...})从列表中不重复地选择多个项目) |
(添加分隔符和相关的seq参数) |
||
第31行: | 第31行: | ||
if not limit then | if not limit then | ||
limit=5 | limit=5 | ||
end | |||
local seq=frame.args.seq | |||
if not seq then | |||
seq="\n" | |||
end | end | ||
local selected=random.main("array",{t=songlist['songs'],limit=limit}) | local selected=random.main("array",{t=songlist['songs'],limit=limit}) | ||
local result="" | local result="" | ||
for | for i, v in ipairs( selected ) do | ||
if i>1 then | |||
result=result..seq | |||
end | |||
local id=v['id'] | local id=v['id'] | ||
local title=SpecialPageName(v['title_localized']['en']) | local title=SpecialPageName(v['title_localized']['en']) |
个编辑