Skip to content

Instantly share code, notes, and snippets.

@rafaelribeiroo
Created December 19, 2023 03:39
Show Gist options
  • Save rafaelribeiroo/91b5c121d084ad36befb4b9056f08188 to your computer and use it in GitHub Desktop.
Save rafaelribeiroo/91b5c121d084ad36befb4b9056f08188 to your computer and use it in GitHub Desktop.
bot-telegram
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