Skip to content

Commit

Permalink
Merge branch 'hotfix-0.8.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rivixer committed Mar 22, 2024
2 parents 17b252f + 4c3cdac commit 10de677
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions sggwbot/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@
from nextcord.utils import format_dt

from sggwbot.console import Console, FontColour
from sggwbot.errors import (ExceptionData, InvalidSettingsFile,
MissingPermission, UpdateEmbedError)
from sggwbot.errors import (
ExceptionData,
InvalidSettingsFile,
MissingPermission,
UpdateEmbedError,
)
from sggwbot.models import ControllerWithEmbed, EmbedModel, Model
from sggwbot.utils import (InteractionUtils, Matcher, SmartDict,
wait_until_midnight)
from sggwbot.utils import InteractionUtils, Matcher, SmartDict, wait_until_midnight

if TYPE_CHECKING:
from nextcord.guild import Guild
Expand All @@ -52,6 +55,7 @@

class SummaryEventTypes(Flag):
"""Types of events to show in the summary."""

VISIBLE = auto()
HIDDEN = auto()
ALL = VISIBLE | HIDDEN
Expand Down Expand Up @@ -1285,9 +1289,9 @@ class CalendarEmbedModel(EmbedModel):
def _get_field_value(self, events: list[Event]) -> str:
truncated_text = "\n∟*... and more.*"
max_length = 1024 - len(truncated_text)
result = f"∟{events[0].full_info}"
result = f"∟{events[0].full_name}"
for event in events[1:]:
event_summary = f"{event.full_info}"
event_summary = f"{event.full_name}"
if len(result) + len(event_summary) > max_length:
result += truncated_text
break
Expand Down Expand Up @@ -1802,7 +1806,6 @@ def load(cls, data: dict[str, Any]) -> _ReminderSettings:

@dataclass(slots=True, frozen=True)
class _ReminderEmbedSettings:

@dataclass(slots=True, frozen=True)
class _Thumbnail:
url: str
Expand Down Expand Up @@ -2525,7 +2528,6 @@ def _send_info_to_console(
old_reminder: Reminder | None,
new_reminder: Reminder,
) -> None:

def get_reminder_info(reminder: Reminder) -> str:
channel = reminder.get_channel(self.guild)
channel_name = channel.name if channel else "Unknown channel"
Expand Down

0 comments on commit 10de677

Please sign in to comment.