Compare commits
3 Commits
76af099702
...
177374a894
Author | SHA1 | Date |
---|---|---|
Stefano Assenzo | 177374a894 | |
Stefano Assenzo | 3f75138d16 | |
Stefano Assenzo | 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 = ""
|
11
app.py
11
app.py
|
@ -1,14 +1,9 @@
|
|||
from flask import Flask, render_template, request, session, jsonify, redirect
|
||||
from dotenv import load_dotenv
|
||||
import requests
|
||||
import urllib.request, json
|
||||
import pymongo
|
||||
from urllib.request import Request, urlopen
|
||||
from flask import Flask, render_template
|
||||
import logging
|
||||
import bcrypt
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
from urllib import request
|
||||
from urllib.request import Request, urlopen
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
|
|
|
@ -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