Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
diff --git a/plugins/administration/allowlink.lua b/plugins/administration/allowlink.lua
index 2ef6c9b..3508bd1 100644
--- a/plugins/administration/allowlink.lua
+++ b/plugins/administration/allowlink.lua
@@ -1,30 +1,31 @@
--[[
Copyright 2020 Matthew Hesketh <matthew@matthewhesketh.com>
This code is licensed under the MIT. See LICENSE for details.
]]
local allowlink = {}
local mattata = require('mattata')
function allowlink:init()
allowlink.commands = mattata.commands(self.info.username):command('allowlink'):command('wl').table
allowlink.help = '/allowlink <links> - Allowlists the given links in the current chat. Requires administrative privileges. Use /allowlink -del <links> to Alias: /wl.'
end
function allowlink:on_message(message)
if not mattata.is_group_admin(message.chat.id, message.from.id) then
return false
end
local input = mattata.input(message.text)
local delete = false
if not input then
return mattata.send_reply(message, 'Please specify the URLs or @usernames you\'d like to allowlist.')
elseif input:match('^%-del .-$') then
input = input:match('^%-del (.-)$')
delete = true
end
+ message.text = input
local output = mattata.check_links(message, false, false, true, false, delete)
return mattata.send_reply(message, output)
end
return allowlink
\ No newline at end of file
diff --git a/plugins/allowlink.lua b/plugins/allowlink.lua
deleted file mode 100644
index 3508bd1..0000000
--- a/plugins/allowlink.lua
+++ /dev/null
@@ -1,31 +0,0 @@
---[[
- Copyright 2020 Matthew Hesketh <matthew@matthewhesketh.com>
- This code is licensed under the MIT. See LICENSE for details.
-]]
-
-local allowlink = {}
-local mattata = require('mattata')
-
-function allowlink:init()
- allowlink.commands = mattata.commands(self.info.username):command('allowlink'):command('wl').table
- allowlink.help = '/allowlink <links> - Allowlists the given links in the current chat. Requires administrative privileges. Use /allowlink -del <links> to Alias: /wl.'
-end
-
-function allowlink:on_message(message)
- if not mattata.is_group_admin(message.chat.id, message.from.id) then
- return false
- end
- local input = mattata.input(message.text)
- local delete = false
- if not input then
- return mattata.send_reply(message, 'Please specify the URLs or @usernames you\'d like to allowlist.')
- elseif input:match('^%-del .-$') then
- input = input:match('^%-del (.-)$')
- delete = true
- end
- message.text = input
- local output = mattata.check_links(message, false, false, true, false, delete)
- return mattata.send_reply(message, output)
-end
-
-return allowlink
\ No newline at end of file

File Metadata

Mime Type
text/x-diff
Expires
Mon, May 11, 7:37 PM (4 d, 20 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
63097
Default Alt Text
(2 KB)

Event Timeline