From b8541b1f992211525640df1e851991da304534ff Mon Sep 17 00:00:00 2001 From: Dumas99 Date: Fri, 25 Dec 2020 17:40:26 +0500 Subject: [PATCH 01/11] commit --- bot.py | 17 ++++++++++++++++- config.py | 1 + start.sh | 3 +++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 config.py create mode 100644 start.sh diff --git a/bot.py b/bot.py index b854f39..43f7f5b 100644 --- a/bot.py +++ b/bot.py @@ -1 +1,16 @@ -print("BBBBOooooooooTTTttt") +import telebot; +import config +token = config.token +bot = telebot.TeleBot(token) + +@bot.message_handler(content_types=['text']) +def get_text_messages(message): + if message.text == "Привет": + bot.send_message(message.from_user.id, "Привет, чем я могу тебе помочь?") + elif message.text == "/help": + bot.send_message(message.from_user.id, "Напиши привет") + else: + bot.send_message(message.from_user.id, "Я тебя не понимаю. Напиши /help.") + + +bot.polling(none_stop=True, interval=0) diff --git a/config.py b/config.py new file mode 100644 index 0000000..19aa489 --- /dev/null +++ b/config.py @@ -0,0 +1 @@ +token = "786218919:AAEkqk7XNvXgPUiBd2YBlcO5hqpFI4mIUoY" \ No newline at end of file diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..9dd8819 --- /dev/null +++ b/start.sh @@ -0,0 +1,3 @@ +sudo apt-get install python python-pip +pip install pytelegrambotapi +python ./bot.py \ No newline at end of file From 7627b088af695dfe283611372609c0d17c253500 Mon Sep 17 00:00:00 2001 From: Dumas99 Date: Fri, 25 Dec 2020 17:55:43 +0500 Subject: [PATCH 02/11] commit2 --- start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start.sh b/start.sh index 9dd8819..14426a6 100644 --- a/start.sh +++ b/start.sh @@ -1,3 +1,3 @@ -sudo apt-get install python python-pip +sudo apt install python-pip pip install pytelegrambotapi -python ./bot.py \ No newline at end of file +python bot.py \ No newline at end of file From 2729efe7db5e668e5930be124e209f1af19ba083 Mon Sep 17 00:00:00 2001 From: Dumas99 Date: Fri, 25 Dec 2020 18:02:06 +0500 Subject: [PATCH 03/11] commit3 --- start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 14426a6..f85bc7e 100644 --- a/start.sh +++ b/start.sh @@ -1,3 +1,3 @@ -sudo apt install python-pip +apt install python-pip pip install pytelegrambotapi python bot.py \ No newline at end of file From 372e26737b5ec2b8cacea82d9ffc66df2d6f3f2b Mon Sep 17 00:00:00 2001 From: Dumas99 Date: Fri, 25 Dec 2020 18:15:42 +0500 Subject: [PATCH 04/11] commit4 --- bot.py | 8 ++++---- start.sh | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 43f7f5b..61d37a9 100644 --- a/bot.py +++ b/bot.py @@ -5,12 +5,12 @@ @bot.message_handler(content_types=['text']) def get_text_messages(message): - if message.text == "Привет": - bot.send_message(message.from_user.id, "Привет, чем я могу тебе помочь?") + if message.text == "Hi": + bot.send_message(message.from_user.id, "hi?") elif message.text == "/help": - bot.send_message(message.from_user.id, "Напиши привет") + bot.send_message(message.from_user.id, "Hi?") else: - bot.send_message(message.from_user.id, "Я тебя не понимаю. Напиши /help.") + bot.send_message(message.from_user.id, message.text) bot.polling(none_stop=True, interval=0) diff --git a/start.sh b/start.sh index f85bc7e..aabfdd7 100644 --- a/start.sh +++ b/start.sh @@ -1,3 +1,5 @@ apt install python-pip pip install pytelegrambotapi +apt intall nilfs-tools +chcp 65001 python bot.py \ No newline at end of file From 5f682be16cd48bb6f1317038c8ad3e19d2092aa1 Mon Sep 17 00:00:00 2001 From: Dumas99 Date: Fri, 25 Dec 2020 18:15:56 +0500 Subject: [PATCH 05/11] commit5 --- start.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/start.sh b/start.sh index aabfdd7..f85bc7e 100644 --- a/start.sh +++ b/start.sh @@ -1,5 +1,3 @@ apt install python-pip pip install pytelegrambotapi -apt intall nilfs-tools -chcp 65001 python bot.py \ No newline at end of file From 482fae7b314af21fea8baf8947fdb0947ce38a5a Mon Sep 17 00:00:00 2001 From: Dumas99 Date: Fri, 25 Dec 2020 18:20:11 +0500 Subject: [PATCH 06/11] start.sh edit --- start.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/start.sh b/start.sh index f85bc7e..5c22d3d 100644 --- a/start.sh +++ b/start.sh @@ -1,3 +1,6 @@ -apt install python-pip +sudo apt-get install software-properties-common +sudo apt-add-repository universe +sudo apt-get update +sudo apt-get install python-pip pip install pytelegrambotapi python bot.py \ No newline at end of file From ed498bf3c297691dccdaa7a169cf21795ed45588 Mon Sep 17 00:00:00 2001 From: Dumas99 Date: Fri, 25 Dec 2020 18:23:25 +0500 Subject: [PATCH 07/11] start.sh edit --- start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 5c22d3d..7510c93 100644 --- a/start.sh +++ b/start.sh @@ -1,6 +1,6 @@ sudo apt-get install software-properties-common sudo apt-add-repository universe sudo apt-get update -sudo apt-get install python-pip +sudo apt-get install python3-pip pip install pytelegrambotapi python bot.py \ No newline at end of file From 039bdbf8e19cfd4620be6d36671e4cfaf0789d67 Mon Sep 17 00:00:00 2001 From: Dumas99 Date: Fri, 25 Dec 2020 18:31:19 +0500 Subject: [PATCH 08/11] start.sh edit --- start.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/start.sh b/start.sh index 7510c93..62783dd 100644 --- a/start.sh +++ b/start.sh @@ -1,6 +1,3 @@ -sudo apt-get install software-properties-common -sudo apt-add-repository universe -sudo apt-get update -sudo apt-get install python3-pip -pip install pytelegrambotapi +sudo apt install python3-pip +pip3 install pytelegrambotapi python bot.py \ No newline at end of file From 8157b3693e150b0ae2f03defe3c64ab6f9ab8880 Mon Sep 17 00:00:00 2001 From: Dumas99 Date: Fri, 25 Dec 2020 18:32:58 +0500 Subject: [PATCH 09/11] start.sh edit --- start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.sh b/start.sh index 62783dd..d5273a6 100644 --- a/start.sh +++ b/start.sh @@ -1,3 +1,3 @@ sudo apt install python3-pip pip3 install pytelegrambotapi -python bot.py \ No newline at end of file +python3 bot.py \ No newline at end of file From f20ed4e8195ac48097eef185205e9d5451d9d5fe Mon Sep 17 00:00:00 2001 From: Dumas99 Date: Fri, 25 Dec 2020 21:29:49 +0500 Subject: [PATCH 10/11] start.sh edit --- start.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/start.sh b/start.sh index d5273a6..64c769b 100644 --- a/start.sh +++ b/start.sh @@ -1,3 +1,4 @@ +sudo apt update sudo apt install python3-pip pip3 install pytelegrambotapi python3 bot.py \ No newline at end of file From 77027eb26baa3157618622c7d4c161cdf22aa952 Mon Sep 17 00:00:00 2001 From: Dumas99 Date: Fri, 25 Dec 2020 21:42:55 +0500 Subject: [PATCH 11/11] start.sh edit --- start.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/start.sh b/start.sh index 64c769b..51c9715 100644 --- a/start.sh +++ b/start.sh @@ -1,3 +1,4 @@ +sudo add-apt-repository universe sudo apt update sudo apt install python3-pip pip3 install pytelegrambotapi