Merge remote-tracking branch 'origin/master'

This commit is contained in:
GaMeNu 2024-07-28 21:19:47 +03:00
commit 44398c5fd3
2 changed files with 34 additions and 1 deletions

View File

@ -2,7 +2,8 @@
## A bot to send Discord notifications for HFC alerts
### Created by GaMeNu and yrrad8
> **IMPORTANT:** This bot is unofficial! Please do not rely on it alone.
> [!WARNING]\
> This bot is unofficial! The public instance may experience downtimes, and there may be issue with the code. Please do not rely on it alone!
## Table of Contents
- [What is this?](#what-is-this)

32
setup.py Normal file
View File

@ -0,0 +1,32 @@
import subprocess
import sys
def newer_python():
return sys.version_info >= (3, 11)
def install_requirements():
try:
if newer_python():
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements-3_11.txt"])
else:
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
print("All requirements have been installed successfully.")
except subprocess.CalledProcessError as e:
print(f"Error occurred while installing requirements: {e}")
def main():
install_requirements()
try:
import db_creation.create_db
import db_access
except ImportError as e:
print(f"Error occurred while importing the module: {e}")
except AttributeError as e:
print(f"Error occurred while calling the function: {e}")
if __name__ == '__main__':
main()