From 76699da73909cbef78029e98d09e42a836c9d92a Mon Sep 17 00:00:00 2001 From: Akamaru Date: Mon, 27 Jul 2015 15:50:19 +0200 Subject: [PATCH] new plugins change_pic.lua: Change the group picture rename:lua Rename group name --- .gitignore | 3 ++- plugins/change_pic.lua | 14 ++++++++++++++ plugins/rename.lua | 12 ++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 plugins/change_pic.lua create mode 100644 plugins/rename.lua diff --git a/.gitignore b/.gitignore index 9707669..4c2c476 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,5 @@ plugins/dantest.lua plugins/flickr.lua plugins/flickr_search.lua plugins/google_books.lua -plugins/safebrowsing.lua \ No newline at end of file +plugins/safebrowsing.lua +plugins/random.lua \ No newline at end of file diff --git a/plugins/change_pic.lua b/plugins/change_pic.lua new file mode 100644 index 0000000..e0f712d --- /dev/null +++ b/plugins/change_pic.lua @@ -0,0 +1,14 @@ +function run(msg, matches) +local receiver = get_receiver(msg) +local url = matches[1] +local file = download_to_file(url) +local cb_extra = {file_path=file} + chat_set_photo(receiver, file, ok_cb, false) +end + +return { + description = "", + usage = {""}, + patterns = {"^/pic (.*)$"}, + run = run +} \ No newline at end of file diff --git a/plugins/rename.lua b/plugins/rename.lua new file mode 100644 index 0000000..fbe8d2e --- /dev/null +++ b/plugins/rename.lua @@ -0,0 +1,12 @@ +function run(msg, matches) +local receiver = get_receiver(msg) +local text = matches[1] + rename_chat(receiver, text, ok_cb, false) +end + +return { + description = "", + usage = {""}, + patterns = {"^/rename (.*)$"}, + run = run +} \ No newline at end of file