Skip to content
This repository has been archived by the owner on Oct 14, 2018. It is now read-only.

Plugin for setting channel name #355

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/set.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ return {
description = "Plugin for saving values. get.lua plugin is necessary to retrieve them.",
usage = "!set [value_name] [data]: Saves the data with the value_name name.",
patterns = {
"!set ([^%s]+) (.+)$"
"^!set ([^%s]+) (.+)$"
},
run = run
}
Expand Down
21 changes: 21 additions & 0 deletions plugins/topic.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

local function run(msg, matches)
local text = matches[1]
local chat = 'chat#id'..msg.to.id

if msg.to.type == 'chat' then
print('rename chat '..chat..' to '..text)
rename_chat(chat, text, ok_cb, false)
else
return 'This isn\'t a chat group'
end
end

return {
description = "set channel topic",
usage = "!topic [whatever]: set channel topic",
patterns = {
"^!topic +(.+)$"
},
run = run
}