Документация
local p = {}
local getArgs = require('Module:Arguments').getArgs
local error = require('Module:Error').error

--[[

=p.main(mw.getCurrentFrame():newChild{title="Обсуждение",args={
	[""]="temp",["te"]="mp",["temp"]="",
	[1]="normie",["label1"]="норми",
	[2]="джимбо",["label2"]="Jimbo",
	[3]="Carn",["p"]=""
	}
})

]]
function p.main(frame)
	local args = getArgs(frame, {removeBlanks = false})
	
	-- задаём названия параметров, которые будут проходить фильтр
	local name1 = "p"
	local pattern1, pattern2 = "l%d+", "label%d+"
	local l, input = 50, {}
	for k,v in pairs(args) do
		if type(k) == "number" 
		or k == name1 
		or string.find(k,pattern1) 
		or string.find(k,pattern2) then
			input[k]=v
		else
			input[l]=k .. "=" .. v
			l = l - 1
		end
	end
	
	local users, limit = {}, tonumber(input.limit) or 50
	-- параметры меньше 1 и больше 50 обрабатываться не будут
	for i = 1,limit do
		if input[i] then 
			users[i] = string.format('[[Участник:%s|%s]]', input[i], input['label' .. i] or input['l' .. i] or input[i])
		end
	end
	
	local i,output = 1,{}
	for n = 1,limit do
		if users[n] then 
			output[i] = users[n]
			i = i + 1
		end
	end

	if not next(output) then
		return error{'Ошибка в [[Шаблон:Reply to]]: имя участника не задано'}
	end
	
	return tostring(
		mw.html.create('span')
			:addClass('template-ping')
			:wikitext('@' .. table.concat(output, ', ') .. ( args['p'] or ':' ))
	)
end

return p