From 38576017f09179f687088c157431051f9c90e8a7 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 Mar 2024 19:15:59 +0000 Subject: [PATCH] auto: format python code --- alexBot/cogs/flight.py | 2 +- alexBot/database.py | 2 +- bot.py | 1 - config.py | 97 ++++++++++++++++++++++++++++++++++++------ 4 files changed, 87 insertions(+), 15 deletions(-) diff --git a/alexBot/cogs/flight.py b/alexBot/cogs/flight.py index efaa777..6631b05 100644 --- a/alexBot/cogs/flight.py +++ b/alexBot/cogs/flight.py @@ -2,11 +2,11 @@ from datetime import datetime, timezone import avwx -from discord import app_commands import discord import geomag import humanize from avwx.exceptions import BadStation +from discord import app_commands from discord.ext import commands from alexBot.tools import Cog diff --git a/alexBot/database.py b/alexBot/database.py index 8e2f435..b0c209c 100644 --- a/alexBot/database.py +++ b/alexBot/database.py @@ -10,9 +10,9 @@ from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine from sqlalchemy.orm import DeclarativeBase, Mapped, MappedAsDataclass, mapped_column, relationship +import config from alexBot.classes import SugeryZone from alexBot.tools import time_cache -import config class Base( diff --git a/bot.py b/bot.py index fb7d798..6245af0 100755 --- a/bot.py +++ b/bot.py @@ -19,7 +19,6 @@ import config - cogs = [ x.stem for x in Path('alexBot/cogs').glob('*.py') diff --git a/config.py b/config.py index 4ee012d..b3aef86 100644 --- a/config.py +++ b/config.py @@ -1,24 +1,97 @@ # config file. copy to `config.py` and fill in your details. import os +from typing import List -mqtt_url = os.environ.get('MQTT_URL') +import discord -ha_webhook_notifs = os.environ.get('HA_WEBHOOK_NOTIFS') +from alexBot.classes import ButtonRole, FeedConfig, RingRate, SugeryUser, SugeryZone +from alexBot.cogs.sugery import Sugery -discord_token = os.environ.get('DISCORD_TOKEN') +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 = os.environ.get('BOT_PREFIX') +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" -# setthe DATABASE_URL env var -db_full_url = os.environ.get("DATABASE_URL") -# 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") +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", + # }, + # ) +]