From 061d763a83db6ff659cc1405d1fdf2b77593cdd9 Mon Sep 17 00:00:00 2001 From: tommy aka doge <59783653+dowoge@users.noreply.github.com> Date: Mon, 13 Jun 2022 17:54:42 -0400 Subject: [PATCH] better map return --- src/modules/commands/map.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/modules/commands/map.lua b/src/modules/commands/map.lua index 08dac28..f5a5968 100644 --- a/src/modules/commands/map.lua +++ b/src/modules/commands/map.lua @@ -13,6 +13,19 @@ commands:Add('map',{},'get map info', function(t) end if not map_name then return t.message:reply('invalid arguments') end if game then + for mn,Map in next, API.MAPS[game] do + if (Map.DisplayName:lower():sub(1,#map_name)==map_name:lower()) then + local map = API.MAPS[game][mn] + local formatted_message = '```'.. + 'Map: '..map.DisplayName..' ('..API.GAMES[game]..')\n'.. + 'ID: '..map.ID..'\n'.. + 'Creator: '..map.Creator..'\n'.. + 'PlayCount: '..map.PlayCount..'\n'.. + 'Published: '..os.date('%A, %B %d %Y @ %I:%M (%p)',map.Date).. + '```' + return t.message:reply(formatted_message) + end + end if API.MAPS[game][map_name] then local map = API.MAPS[game][map_name] local formatted_message = '```'..