Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F620290
echo.lua
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
845 B
Referenced Files
None
Subscribers
None
echo.lua
View Options
--[[
Copyright 2020 Matthew Hesketh <matthew@matthewhesketh.com>
This code is licensed under the MIT. See LICENSE for details.
]]
local
echo
=
{}
local
mattata
=
require
(
'mattata'
)
function
echo
:
init
()
echo
.
commands
=
mattata
.
commands
(
self
.
info
.
username
):
command
(
'echo'
):
command
(
'say'
).
table
echo
.
help
=
'/echo <text> - Repeats the given string of text. Append -del to the end of your text to delete your command message. Alias: /say.'
end
function
echo
.
on_message
(
_
,
message
)
local
input
=
mattata
.
input
(
message
.
text
)
if
not
input
then
return
mattata
.
send_reply
(
message
,
echo
.
help
)
elseif
input
:
match
(
' %-d$'
)
then
input
=
input
:
match
(
'^(.-) %-d$'
)
mattata
.
delete_message
(
message
.
chat
.
id
,
message
.
message_id
)
end
return
mattata
.
send_message
(
message
.
chat
.
id
,
input
)
end
return
echo
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 14, 5:49 PM (14 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
120849
Default Alt Text
echo.lua (845 B)
Attached To
Mode
R69 mattata
Attached
Detach File
Event Timeline