diff --git a/.env.example b/.env.example index d10a015..16bc209 100644 --- a/.env.example +++ b/.env.example @@ -14,4 +14,12 @@ DOWNLOAD_FOLDER = "" USERNAME_NUVOLA = "" PASSWORD_NUVOLA = "" -DISCORD_TOKEN = "" \ No newline at end of file +# Discord +DISCORD_TOKEN = "" +GENERAL_ID = "" + +# Whatsapp +SID = "" +AUTHTOKEN = "" +PHONE_NUMBER_BOT = "" +PHONE_NUMBER_PERSONAL = "" \ No newline at end of file diff --git a/src/bot/discord/discord_bot.py b/src/bot/discord/discord_bot.py index d8eb48a..9918190 100644 --- a/src/bot/discord/discord_bot.py +++ b/src/bot/discord/discord_bot.py @@ -18,6 +18,7 @@ import time load_dotenv() # Load .env file DISCORD_TOKEN = os.getenv('DISCORD_TOKEN') # Discord token +GENERAL_ID = os.getenv('GENERAL_ID') # Channel ID PASSWORD_MONGODB = os.getenv('PASSWORD_MONGODB') # Password for MongoDB URL_MONGODB = os.getenv('URL_MONGODB') # URL for MongoDB mongo_url = "mongodb+srv://elci:" + urllib.parse.quote_plus(PASSWORD_MONGODB) + URL_MONGODB # URL for MongoDB (with password) @@ -68,7 +69,7 @@ async def orario(): send_screenshot += 1 else: pass - channel = bot.get_channel(1063753802638954519) + channel = bot.get_channel(GENERAL_ID) await channel.send(f"Day: {day}, Hour school: {i}, Subject found: {subject['Subject']} at index: {i}") send_screenshot = 0 diff --git a/src/bot/whatsapp/whatsapp_bot.py b/src/bot/whatsapp/whatsapp_bot.py new file mode 100644 index 0000000..4cfc3e8 --- /dev/null +++ b/src/bot/whatsapp/whatsapp_bot.py @@ -0,0 +1,13 @@ +from twilio.rest import Client +import os + +SID = os.getenv('SID') +AUTH_TOKEN = os.getenv('AUTHTOKEN') +PHONE_NUMBER_BOT = os.getenv('PHONE_NUMBER_BOT') +PHONE_NUMBER_PERSONAL = os.getenv('PHONE_NUMBER_PERSONAL') + +client = Client(SID, AUTH_TOKEN) + +message=client.messages.create(to=PHONE_NUMBER_PERSONAL, + from_=PHONE_NUMBER_BOT, + body="Hello from Python!") \ No newline at end of file