diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index c2f97b7..0000000 --- a/.dockerignore +++ /dev/null @@ -1,5 +0,0 @@ -.github/ -.ruff_cache/ -.venv/ -postgres_data/ -__pycache__/ \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index 8a69253..0000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,24 +0,0 @@ -version: "2" - -services: - bot: - build: . - depends_on: - - postgres - environment: - - POSTGRES_HOST=postgres - - POSTGRES_PORT=5432 - - POSTGRES_DB_NAME=blockbot - restart: unless-stopped - - postgres: - image: postgres:16.2-alpine3.19 - environment: - POSTGRES_DB: blockbot - PGDATA: /var/lib/postgresql/data - restart: unless-stopped - volumes: - - ./postgres_data:/var/lib/postgresql/data - -volumes: - postgres_data: \ No newline at end of file diff --git a/src/database.py b/src/database.py index 7a21d1c..d8c3db4 100644 --- a/src/database.py +++ b/src/database.py @@ -11,19 +11,22 @@ Base = declarative_base() Session = async_sessionmaker(bind=engine) + async def init_db() -> None: async with engine.begin() as conn: await conn.run_sync(Base.metadata.create_all) + # TODO: add reprs? + class StarboardSettings(Base): __tablename__ = "starboard_settings" guild = Column(BigInteger, nullable=False, primary_key=True) channel = Column(BigInteger, nullable=True) threshold = Column(SmallInteger, nullable=False, default=3) - + class Starboard(Base): __tablename__ = "starboard" diff --git a/src/extensions/boosts.py b/src/extensions/boosts.py index b4532ad..b7ad3bb 100644 --- a/src/extensions/boosts.py +++ b/src/extensions/boosts.py @@ -27,7 +27,9 @@ def build_boost_message( assert message_type in BOOST_MESSAGE_TYPES base_message = f"{booster_user.display_name} just boosted the server" - multiple_boosts_message = f" **{number_of_boosts}** times" if number_of_boosts else "" + multiple_boosts_message = ( + f" **{number_of_boosts}** times" if number_of_boosts else "" + ) message = base_message + multiple_boosts_message + "!" diff --git a/src/extensions/user_roles.py b/src/extensions/user_roles.py index b7ecbc8..e86ef13 100644 --- a/src/extensions/user_roles.py +++ b/src/extensions/user_roles.py @@ -66,7 +66,10 @@ async def remove_role( int(role), reason=f"{ctx.author} removed role.", ) - await ctx.respond(f"Done! Removed {role_mention(role)} from your roles.", flags=hikari.MessageFlag.EPHEMERAL) + await ctx.respond( + f"Done! Removed {role_mention(role)} from your roles.", + flags=hikari.MessageFlag.EPHEMERAL, + ) @role.set_error_handler