parent
68a4d440e6
commit
d7c4f7e14c
4 changed files with 20 additions and 2 deletions
@ -1,13 +1,27 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import config |
||||
import logging |
||||
import requests |
||||
from telegram.ext import Updater, MessageHandler, Filters |
||||
|
||||
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - \ |
||||
%(message)s', level=logging.INFO) |
||||
|
||||
|
||||
def message_handling(bot, update): |
||||
pass |
||||
print("in here") |
||||
if update.message.chat.id in config.groups: |
||||
print("in here") |
||||
for i in update.message.text.split("\n"): |
||||
params = {"message": (f"TG - {update.message.from_user.first_name}" |
||||
f": {i}")} |
||||
requests.post("http://localhost:" + str(config.port) + "/post", |
||||
data=params) |
||||
print(params) |
||||
|
||||
|
||||
updater = Updater(token=config.api_key) |
||||
dispatcher = updater.dispatcher |
||||
dispatcher.add_handler(MessageHandler(Filters.text, message_handling)) |
||||
updater.start_polling() |
||||
|
Loading…
Reference in new issue