From 36e4a20adae28ea066dcc80ec14d8350bc62e31a Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sat, 14 Jan 2023 20:53:43 +0000 Subject: shop2 --- shop2/main.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shop2/main.lua b/shop2/main.lua index 20440a5..a79ab6f 100644 --- a/shop2/main.lua +++ b/shop2/main.lua @@ -41,7 +41,13 @@ local function proctrans(tr) if tr.type ~= "transfer" then return end if tr.sent_name ~= OURNAME then return end local meta = parsemeta(tr.metadata) - local function tell(msg) if meta.username then chatbox.tell(meta.username,msg) end end + local function tell(msg) + if meta.username then + if not pcall(chatbox.tell,meta.username,msg) then + print("chatbox error, couldn't tell "..meta.username..": "..msg) + end + end + end local function refund() if meta['return'] then sendws { type="make_transaction", to=meta['return'], amount=tr.value } end end local mtn = tr.sent_metaname -- cgit v1.2.3