comparison src/add_server.js.luan @ 16:552d6f944acb

add bump
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 01 Nov 2023 17:34:15 -0600
parents af2b95854072
children
comparison
equal deleted inserted replaced
15:d0b8e1a8fc69 16:552d6f944acb
1 local Luan = require "luan:Luan.luan" 1 local Luan = require "luan:Luan.luan"
2 local error = Luan.error 2 local error = Luan.error
3 local String = require "luan:String.luan" 3 local String = require "luan:String.luan"
4 local regex = String.regex or error() 4 local regex = String.regex or error()
5 local Time = require "luan:Time.luan"
6 local time_now = Time.now or error()
5 local Io = require "luan:Io.luan" 7 local Io = require "luan:Io.luan"
6 local Http = require "luan:http/Http.luan" 8 local Http = require "luan:http/Http.luan"
7 local Shared = require "site:/lib/Shared.luan" 9 local Shared = require "site:/lib/Shared.luan"
8 local js_error = Shared.js_error or error() 10 local js_error = Shared.js_error or error()
9 local Server = require "site:/lib/Server.luan" 11 local Server = require "site:/lib/Server.luan"
32 end 34 end
33 run_in_transaction( function() 35 run_in_transaction( function()
34 local server = Server.new{ 36 local server = Server.new{
35 owner_discord_id = get_user() or error() 37 owner_discord_id = get_user() or error()
36 discord_id = id 38 discord_id = id
39 bumped = time_now()
37 name = name 40 name = name
38 icon = icon 41 icon = icon
39 invite = invite 42 invite = invite
40 } 43 }
41 server.save() 44 server.save()