Created
December 19, 2023 03:39
-
-
Save rafaelribeiroo/91b5c121d084ad36befb4b9056f08188 to your computer and use it in GitHub Desktop.
bot-telegram
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from asyncio import get_event_loop | |
from telegram import Bot | |
from configparser import ConfigParser | |
config = ConfigParser() | |
config.read('config.ini') | |
day = config['FACEBOOK']['interval'] | |
bot = Bot(config['TELEGRAM']['token']) | |
async def send_message(txt): | |
from pdb import set_trace; set_trace() | |
await bot.send_message( | |
chat_id=config['TELEGRAM']['chat_id'], | |
text=txt, | |
read_timeout=60, | |
write_timeout=60, | |
connect_timeout=60 | |
) | |
loop = get_event_loop() | |
# if not ad['previous_price']: | |
loop.run_until_complete(send_message('Testing')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment