Now it's all about .env - I started making Whatsapp bot
This commit is contained in:
parent
76af099702
commit
23ac13f5d1
10
.env.example
10
.env.example
|
@ -14,4 +14,12 @@ DOWNLOAD_FOLDER = ""
|
|||
USERNAME_NUVOLA = ""
|
||||
PASSWORD_NUVOLA = ""
|
||||
|
||||
DISCORD_TOKEN = ""
|
||||
# Discord
|
||||
DISCORD_TOKEN = ""
|
||||
GENERAL_ID = ""
|
||||
|
||||
# Whatsapp
|
||||
SID = ""
|
||||
AUTHTOKEN = ""
|
||||
PHONE_NUMBER_BOT = ""
|
||||
PHONE_NUMBER_PERSONAL = ""
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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!")
|
Loading…
Reference in New Issue