fix: check_self wywala się na starcie, gdy kanał = None #13

Merged
gitea merged 1 commits from fix-check-self-none-channel into main 2026-08-02 17:01:39 +00:00

1 Commits

Author SHA1 Message Date
gitea 8ac68df1c9 Fix check_self crashing at startup on a None channel
CI / compile (pull_request) Successful in 41s
CI / unit (pull_request) Successful in 20s
CI / integration (pull_request) Successful in 28s
build / build (push) Successful in 41s
CI / compile (push) Successful in 9s
CI / unit (push) Successful in 21s
CI / integration (push) Successful in 25s
check_self starts in setup() (during on_ready), and its first tick can
fire before the gateway has populated the channel cache - get_channel()
then returns None and channel.history() raises AttributeError. Because an
unhandled exception stops a tasks.loop, this also silently killed the log
rollover and spontaneous messages the loop is responsible for.

Add a before_loop that awaits wait_until_ready() (fixes the startup race)
and a None guard that skips the tick with a warning (keeps the loop alive
even if the channel is genuinely unreachable: wrong id / not in the guild
/ missing permission).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 17:36:59 +02:00