Files
OpenBB/bots/config_discordbot.py
Colin Delahunty dd4734bd90 Added Tests for Bots (#1523)
* Added common/helper tests

* expanded bot testing

* few changes

* import fix

* missed removing test config

* column order fix

* import fix

* removed df2img add new deps

* req

* update readme

* add dep for image export, fix

* get rid of yahoo-fin, add image export lib

* import issues in some machines fix

* images dir fix

* init fix

* fix?

* test

* test

* Fixed text handling

* missed a tbl

* Fixed tests

* Fixed poetry

* Fixed kaliedo

* Fixed codecov

* Fixed dependencies

* Added fix

* FIxed tests

* Added image cleanup

* Added tests

* Fixed tests

* Added test fix

* Added conda

* Updated bot path

* refactor

* poetry

* update dict/ fix slack image upload

* Update config_discordbot.py

* Updated

* Fixed tests

* Skipped energy

* fixes

* black

* fix

* import

* fix nan on smile

* added env settings

* add cmds_text dict, some chgs

* merge bot test fixes

* fix duplicate

Co-authored-by: teh_coderer <me@tehcoderer.com>
Co-authored-by: Colin Delahunty <colindelahunty@MacBook-Pro.local>
Co-authored-by: Chavithra <chavithra@gmail.com>
2022-03-25 18:21:41 -04:00

71 lines
2.1 KiB
Python
Executable File

import os
import sys
from distutils.util import strtobool
from pathlib import Path
from typing import List, Optional
import disnake
import pyimgur
from dotenv import load_dotenv
# Path to bots
bots_path = Path(__file__).parent.resolve()
env_files = [f for f in bots_path.iterdir() if f.__str__().endswith(".env")]
if env_files:
load_dotenv(env_files[0])
# Relative path to the terminal
sys.path.append("..")
# https://discord.com/developers/applications/
DISCORD_BOT_TOKEN = os.getenv("GT_DISCORD_BOT_TOKEN") or "REPLACE_ME"
# https://apidocs.imgur.com
IMGUR_CLIENT_ID = os.getenv("GT_IMGUR_CLIENT_ID") or "REPLACE_ME"
# https://newsapi.org
API_NEWS_TOKEN = os.getenv("GT_API_NEWS_TOKEN") or "REPLACE_ME"
# https://www.binance.com/en/
API_BINANCE_KEY = os.getenv("GT_API_BINANCE_KEY") or "REPLACE_ME"
API_BINANCE_SECRET = os.getenv("GT_API_BINANCE_SECRET") or "REPLACE_ME"
# https://finnhub.io
API_FINNHUB_KEY = os.getenv("GT_API_FINNHUB_KEY") or "REPLACE_ME"
# Settings
SLASH_TESTING_SERVERS: Optional[
List[int]
] = None # Add server ID for testing [1884912191119489, 1454644614118448]
COMMAND_PREFIX = "!"
DATE_FORMAT = "%Y-%m-%d"
COLOR = disnake.Color.from_rgb(255, 0, 0)
# Interactive Chart Settings
INTERACTIVE = strtobool(os.getenv("GT_INTERACTIVE", "False"))
INTERACTIVE_DIR = bots_path.joinpath("interactive/")
INTERACTIVE_URL = ""
# Image Settings
IMG_HOST_ACTIVE = strtobool(os.getenv("GT_IMG_HOST_ACTIVE", "False"))
IMG_DIR = bots_path.joinpath("interactive/images/")
IMAGES_URL = "" # Ex. "http://your-site.com/images/"
# IMG_BG = bots_path.joinpath("files/bg.png") # Light BG
IMG_BG = bots_path.joinpath("files/bg-dark.png") # Dark BG
DEBUG = strtobool(os.getenv("GT_DEBUG", "False"))
GST_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
gst_imgur = pyimgur.Imgur(IMGUR_CLIENT_ID)
AUTHOR_NAME = "Gamestonk Terminal"
AUTHOR_URL = "https://github.com/GamestonkTerminal/GamestonkTerminal"
AUTHOR_ICON_URL = (
"https://github.com/GamestonkTerminal/GamestonkTerminal/"
"blob/main/images/gst_logo_green_white_background.png?raw=true"
)