From ee9e344331d0db6401d138c752bd7cc504ef7ba4 Mon Sep 17 00:00:00 2001 From: Alexander Terry Date: Fri, 22 Mar 2024 11:19:55 -0800 Subject: [PATCH] remove config copy in autoformat --- .github/workflows/autoformat.yml | 3 - config.py | 99 ++++---------------------------- example_config.py | 97 ------------------------------- 3 files changed, 12 insertions(+), 187 deletions(-) delete mode 100755 example_config.py diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index bfb7137..1681d8c 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -16,9 +16,6 @@ jobs: - name: Install pip modules run: pip install black isort - - name: copy config for isort sanity - run: cp example_config.py config.py - - name: Run isort run: isort . diff --git a/config.py b/config.py index b3aef86..d29d3ab 100644 --- a/config.py +++ b/config.py @@ -1,97 +1,22 @@ -# config file. copy to `config.py` and fill in your details. - import os -from typing import List - -import discord - -from alexBot.classes import ButtonRole, FeedConfig, RingRate, SugeryUser, SugeryZone -from alexBot.cogs.sugery import Sugery - -hass_token = os.environ.get('HASS_TOKEN') - -hass_host = os.environ.get('HASS_HOST') -hass_target = os.environ.get('HASS_TARGET') +mqtt_url = os.environ.get('MQTT_URL') -ha_webhook_notifs: str = None +ha_webhook_notifs = os.environ.get('HA_WEBHOOK_NOTIFS') - -token = os.environ.get('BOT_TOKEN') +discord_token = os.environ.get('DISCORD_TOKEN') cat_token = os.environ.get('THECATAPI_KEY') -prefix = "a!" - -location = "prod or dev" - - -nerdiowoBannedPhrases = ['elon', 'musk', 'tesla'] - -nerdiowoRoles = { - "Texas": 1052661471034736710, - "Germany": 1052568850694164571, - "North Carolina": 1052405508277031063, - "Alaskan": 1052376307696148571, - "UK": 1052070749550153789, -} - - -nerdiowoRolesMessageId = None - -feedPosting: List[FeedConfig] = [ - FeedConfig( - 1054601016315744296, # a tag ID - "https://www.youtube.com/feeds/videos.xml?channel_id=UCO-zhhas4n_kAPHaeLe1qnQ", # techdiff - ), -] - - -logging = { - 'info': 'webhook url here', - 'warning': 'webhook here too', - 'error': 'webhook url here three', -} -# bots who's owner gets a dm whenever they go offline -monitored_bots = { - 288369203046645761: { # Mousey - 'messagable_id': 69198249432449024, # the bot channel in mousey's server - 'shards': 2, - }, - 701277606758318090: { # parakarry - 'messagable_id': 125233822760566784, # mattBSG - 'shared_guild': 314857672585248768, # a shared guild. will be used instead of scanning any guilds. - }, -} - - -ringRates = { - discord.Status.online: RingRate(4, 0.5), - discord.Status.idle: RingRate(10, 1), - discord.Status.dnd: RingRate(1, 1), - discord.Status.offline: RingRate(15, 5), -} - - -listenServers = [272885620769161216] -listens = ['alex', 'alaska'] - -db = "configs.db" +prefix = os.environ.get('BOT_PREFIX') -neosTZData = r"..\neostz\data.json" +# setthe DATABASE_URL env var +db_full_url = os.environ.get("DATABASE_URL") -suggery = [ - # SugeryUser( - # guild=0, - # user=0, - # baseURL="https://someUser.herokuapp.com", - # names={ - # SugeryZone.VERYLOW: "very low", - # SugeryZone.LOW: "low", - # SugeryZone.NORMAL: "normal", - # SugeryZone.HIGH: "high", - # SugeryZone.VERYHIGH: "very high", - # }, - # ) -] +# OR set all of these: +db_user = os.environ.get("POSTGRES_USER") +db_pw = os.environ.get("POSTGRES_PASSWORD") +db_name = os.environ.get("POSTGRES_DB") +db_host = os.environ.get("POSTGRES_HOST") +db_port = os.environ.get("POSTGRES_PORT") diff --git a/example_config.py b/example_config.py deleted file mode 100755 index b3aef86..0000000 --- a/example_config.py +++ /dev/null @@ -1,97 +0,0 @@ -# config file. copy to `config.py` and fill in your details. - -import os -from typing import List - -import discord - -from alexBot.classes import ButtonRole, FeedConfig, RingRate, SugeryUser, SugeryZone -from alexBot.cogs.sugery import Sugery - -hass_token = os.environ.get('HASS_TOKEN') - -hass_host = os.environ.get('HASS_HOST') - -hass_target = os.environ.get('HASS_TARGET') - -ha_webhook_notifs: str = None - - -token = os.environ.get('BOT_TOKEN') - -cat_token = os.environ.get('THECATAPI_KEY') - -prefix = "a!" - -location = "prod or dev" - - -nerdiowoBannedPhrases = ['elon', 'musk', 'tesla'] - -nerdiowoRoles = { - "Texas": 1052661471034736710, - "Germany": 1052568850694164571, - "North Carolina": 1052405508277031063, - "Alaskan": 1052376307696148571, - "UK": 1052070749550153789, -} - - -nerdiowoRolesMessageId = None - -feedPosting: List[FeedConfig] = [ - FeedConfig( - 1054601016315744296, # a tag ID - "https://www.youtube.com/feeds/videos.xml?channel_id=UCO-zhhas4n_kAPHaeLe1qnQ", # techdiff - ), -] - - -logging = { - 'info': 'webhook url here', - 'warning': 'webhook here too', - 'error': 'webhook url here three', -} -# bots who's owner gets a dm whenever they go offline -monitored_bots = { - 288369203046645761: { # Mousey - 'messagable_id': 69198249432449024, # the bot channel in mousey's server - 'shards': 2, - }, - 701277606758318090: { # parakarry - 'messagable_id': 125233822760566784, # mattBSG - 'shared_guild': 314857672585248768, # a shared guild. will be used instead of scanning any guilds. - }, -} - - -ringRates = { - discord.Status.online: RingRate(4, 0.5), - discord.Status.idle: RingRate(10, 1), - discord.Status.dnd: RingRate(1, 1), - discord.Status.offline: RingRate(15, 5), -} - - -listenServers = [272885620769161216] -listens = ['alex', 'alaska'] - -db = "configs.db" - -neosTZData = r"..\neostz\data.json" - - -suggery = [ - # SugeryUser( - # guild=0, - # user=0, - # baseURL="https://someUser.herokuapp.com", - # names={ - # SugeryZone.VERYLOW: "very low", - # SugeryZone.LOW: "low", - # SugeryZone.NORMAL: "normal", - # SugeryZone.HIGH: "high", - # SugeryZone.VERYHIGH: "very high", - # }, - # ) -]