Add logo and fix bug
This commit is contained in:
parent
62e6b19a6f
commit
1fe4ae3315
|
@ -1,7 +1,4 @@
|
||||||
BOT_TOKEN = ""
|
BOT_TOKEN = ""
|
||||||
USER_MONGODB = ""
|
USER_MONGODB = ""
|
||||||
PASSWORD_MONGODB = ""
|
PASSWORD_MONGODB = ""
|
||||||
URL_MONGODB = ""
|
URL_MONGODB = ""
|
||||||
DATABASE= ""
|
|
||||||
COLLECTION_ID-USER = ""
|
|
||||||
COLLECTION_LIST-GAME = ""
|
|
11
main.py
11
main.py
|
@ -14,16 +14,13 @@ API_TOKEN = os.getenv('BOT_TOKEN') #Token for Telegram bot
|
||||||
USER_MONGO = os.getenv('USER_MONGODB') #User for MongoDB
|
USER_MONGO = os.getenv('USER_MONGODB') #User for MongoDB
|
||||||
PASSWORD_MONGO = os.getenv('PASSWORD_MONGODB') #Password for MongoDB
|
PASSWORD_MONGO = os.getenv('PASSWORD_MONGODB') #Password for MongoDB
|
||||||
URL_MONGO = os.getenv('URL_MONGODB') #URL for MongoDB
|
URL_MONGO = os.getenv('URL_MONGODB') #URL for MongoDB
|
||||||
DATABASE = os.getenv('DATABASE') #Database name
|
|
||||||
COLLECTION_ID_USER = os.getenv('COLLECTION_ID-USER') #Collection name (id-user)
|
|
||||||
COLLECTION_LIST_GAME = os.getenv('COLLECTION_LIST-GAME') #Collection name (list-game)
|
|
||||||
|
|
||||||
#Connect to MongoDB
|
#Connect to MongoDB
|
||||||
mongo_url = "mongodb+srv://"+USER_MONGO+":" + urllib.parse.quote_plus(PASSWORD_MONGO) + URL_MONGO #URL for MongoDB (with password)
|
mongo_url = "mongodb+srv://stefano:" + urllib.parse.quote_plus(PASSWORD_MONGO) + URL_MONGO #URL for MongoDB (with password)
|
||||||
client = pymongo.MongoClient(mongo_url) #Connect to MongoDB
|
client = pymongo.MongoClient(mongo_url) #Connect to MongoDB
|
||||||
database = client[DATABASE] #Database name
|
database = client["epicgames-notifier"] #Database name
|
||||||
collection_id = database[COLLECTION_ID_USER] #Collection name (id-user)
|
collection_id = database["id-user"] #Collection name (id-user)
|
||||||
collection_game = database[COLLECTION_LIST_GAME] #Collection name (list-game)
|
collection_game = database["list-game"] #Collection name (list-game)
|
||||||
|
|
||||||
bot = telebot.TeleBot(API_TOKEN) #Connect to Telegram API
|
bot = telebot.TeleBot(API_TOKEN) #Connect to Telegram API
|
||||||
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
|
@ -1,13 +1,14 @@
|
||||||
import requests
|
import requests
|
||||||
import os
|
import os
|
||||||
from bson.objectid import ObjectId
|
from bson.objectid import ObjectId
|
||||||
url = "https://api.plenusbot.xyz/epic_games?country=IT"
|
|
||||||
response = requests.get(url).json()
|
|
||||||
|
|
||||||
def notification_game1(collection_game, collection_id, bot):
|
def notification_game1(collection_game, collection_id, bot):
|
||||||
try:
|
try:
|
||||||
print("Try to send first game")
|
print("Try to send first game")
|
||||||
|
|
||||||
|
url = "https://api.plenusbot.xyz/epic_games?country=IT"
|
||||||
|
response = requests.get(url).json()
|
||||||
|
|
||||||
#All information for first game
|
#All information for first game
|
||||||
current_games_title1 = response['currentGames'][0]['title'] # First title current games
|
current_games_title1 = response['currentGames'][0]['title'] # First title current games
|
||||||
current_games_description1 = response['currentGames'][0]['description'] # First description current games
|
current_games_description1 = response['currentGames'][0]['description'] # First description current games
|
||||||
|
|
Loading…
Reference in New Issue