Skip to content

Commit

Permalink
Account for updated tatsu package.
Browse files Browse the repository at this point in the history
- Also, make a comment on a listener.
  • Loading branch information
Sachaa-Thanasius committed Nov 10, 2023
1 parent b6d18cb commit 849d108
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions exts/notifications/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import core

from .aci_notifications import setup_listeners as setup_aci_listeners
from .aci_notifications import make_listeners as make_aci_listeners
from .rss_notifications import RSSNotificationsCog


async def setup(bot: core.Beira) -> None:
"""Connects listeners and cog to bot."""

aci_listener_info = setup_aci_listeners(bot)
aci_listener_info = make_aci_listeners(bot)
for listener, event_name in aci_listener_info:
bot.add_listener(listener, event_name)

Expand Down
13 changes: 9 additions & 4 deletions exts/notifications/aci_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ async def on_server_boost_role_member_update(
before: discord.Member,
after: discord.Member,
) -> None:
"""Listener that sends a notification if members of the ACI100 server earn certain roles.
Condition for activating:
- Boost the server and earn the premium subscriber, or "Server Booster", role.
"""

# The ID of the guild this listener is for.
aci_guild_id: int = core.CONFIG.discord.important_guilds["prod"][0]

Expand All @@ -62,9 +68,8 @@ async def on_leveled_role_member_update(
) -> None:
"""Listener that sends a notification if members of the ACI100 server earn certain roles.
Conditions for activating are:
1) Earn a Tatsu leveled role above "The Ears".
2) Boost the server and earn the premium subscriber, or "Server Booster", role.
Condition for activating:
- Earn a Tatsu leveled role above "The Ears".
"""

# The ID of the guild this listener is for.
Expand Down Expand Up @@ -154,7 +159,7 @@ async def test_on_any_message_delete(bot: core.Beira, payload: discord.RawMessag
await delete_log_channel.send(content)


def setup_listeners(bot: core.Beira) -> tuple[tuple[functools.partial[Any], str], ...]:
def make_listeners(bot: core.Beira) -> tuple[tuple[functools.partial[Any], str], ...]:
"""Connects listeners to bot."""

# The webhook url that will be used to send ACI-related notifications.
Expand Down
2 changes: 1 addition & 1 deletion exts/tatsu_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import discord
import matplotlib.pyplot as plt
import numpy as np
import tatsu
import tatsu_api as tatsu
from discord.ext import commands

import core
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ msgspec[toml]
numpy
openai>=1.1.0
Pillow>=10.0.0
tatsu @ git+https://github.com/Sachaa-Thanasius/Tatsu.git
tatsu-api>=1.0.0
typing_extensions>=4.5.0,<5
wavelink>=2.6.3,<3
wavelink-stubs
Expand Down

0 comments on commit 849d108

Please sign in to comment.