do

local function del_mc_color(grr)
	grr = string.gsub(grr, '§b', '')
	grr = string.gsub(grr, '§l', '')
	grr = string.gsub(grr, '§7', '')
	grr = string.gsub(grr, '§r', '')
	grr = string.gsub(grr, '§2', '')
	grr = string.gsub(grr, '§c', '')
	
	return grr
end

local function get_pmc(post)
  local url = 'https://api.pegelf.de/mc'
  local res,code  = https.request(url)
  local data = json:decode(res)
  if code ~= 200 then return "HTTP-Fehler" end
  if not data then return "HTTP-Fehler" end
 
  local title = del_mc_color(data.motd)
  local title2 = data.brand
  local vers = data.version
  local map = data.map
  local max_play = data.max_players
  
  local text = unescape(title..'\n'..title2..' ('..vers..')\nWelt: '..map..'\nMax. Spieler: '..max_play..'\n')

    return text
end

local function run(msg, matches)
  local text = get_pmc(post)
  return text
end

return {
  description = "Sendet letzten Aka's Blog Beitrag", 
  usage = "",
  patterns = {"^#[Pp][Mm][Cc]$"},
  run = run 
}

end