13
|
1 local Luan = require "luan:Luan.luan"
|
|
2 local error = Luan.error
|
|
3 local Io = require "luan:Io.luan"
|
|
4 local Http = require "luan:http/Http.luan"
|
|
5 local Server = require "site:/lib/Server.luan"
|
|
6 local Utils = require "site:/lib/Utils.luan"
|
|
7 local get_user = Utils.get_user or error()
|
|
8
|
|
9
|
|
10 return function()
|
|
11 local server_id = Http.request.parameters.server or error()
|
|
12 local server = Server.get_by_id(server_id)
|
|
13 server.owner_discord_id == get_user() or error()
|
|
14 server.delete()
|
|
15 Io.stdout = Http.response.text_writer()
|
|
16 %>
|
|
17 location.reload();
|
|
18 <%
|
|
19 end
|