Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@


import os
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler
from telegram.ext import ConversationHandler, JobQueue
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, error
from instagrapi import exceptions, Client

import os
from dotenv import load_dotenv
load_dotenv()
import sys
import configparser
import sqlite3
Expand All @@ -19,12 +22,15 @@

def load_settings() -> None:
global settings
if not os.path.exists('bot_settings.ini'):
sys.exit('FAILED TO FIND SETTING FILE!')
if not os.path.exists('.env'):
sys.exit('FAILED TO FIND ENV FILE!')
else:
config = configparser.ConfigParser()
config.read('bot_settings.ini')
settings = config['BOT']
from dotenv import load_dotenv
load_dotenv()
settings = {
'owner_id': os.getenv('TELEGRAM_BOT_OWNER_ID'),
'bot_token': os.getenv('TELEGRAM_BOT_TOKEN')
}


def initiate_db() -> None:
Expand Down