From 214b621cdf8f8556dfb23ea1c0fce49629d968d3 Mon Sep 17 00:00:00 2001 From: Er2 Date: Tue, 18 Jan 2022 18:25:18 +0300 Subject: [PATCH] openrc script, some changes --- bot.rc | 15 +++++++++++++++ src/events/inlineQuery.lua | 7 ++++++- src/events/ready.lua | 6 ++++-- start.sh | 3 +++ 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100755 bot.rc create mode 100755 start.sh diff --git a/bot.rc b/bot.rc new file mode 100755 index 0000000..0fa6fdb --- /dev/null +++ b/bot.rc @@ -0,0 +1,15 @@ +#!/sbin/openrc-run +# My bot service + +# CHANGE VALUES TO MATCH YOURS + +name="mybot" +description="My bot" +command="/home/er2/comp-tg/start.sh" +command_args="" +command_user="er2:er2" +command_background=true + +depend() {} + +pidfile="/run/${RC_SVCNAME}.pid" diff --git a/src/events/inlineQuery.lua b/src/events/inlineQuery.lua index 8036875..b521fa6 100644 --- a/src/events/inlineQuery.lua +++ b/src/events/inlineQuery.lua @@ -1,3 +1,8 @@ return function(C, api, q) - api.inline:answer(q.id, api.inline.result('photo', '1', 'https://cdn.discordapp.com/attachments/871474214270554124/876506659311202395/unknown.png'):thumb('https://cdn.discordapp.com/attachments/871474214270554124/876506659311202395/unknown.png')) + api.inline + :answer(q.id, api.inline.result( + 'photo', '1', + 'https://cdn.discordapp.com/attachments/871474214270554124/876506659311202395/unknown.png' + ):thumb 'https://cdn.discordapp.com/attachments/871474214270554124/876506659311202395/unknown.png' + ) end diff --git a/src/events/ready.lua b/src/events/ready.lua index 8790990..2e149d3 100644 --- a/src/events/ready.lua +++ b/src/events/ready.lua @@ -39,8 +39,10 @@ return function(C, api) end api:setMyCommands(a) +--[[ a = {'levels', } for i = 1, #a do - if not C.db[a[i]] then C.db[a[i]] = {} end + if not C.db[a[i] ] then C.db[a[i] ] = {} end end -end \ No newline at end of file +--]] +end diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..dd7d2e5 --- /dev/null +++ b/start.sh @@ -0,0 +1,3 @@ +#!/bin/sh +cd $(dirname $0) +lua5.3 init.lua