Reuse ChannelHelper for channel lookups #593

Open
opened 2026-10-27 13:01:37 +00:00 by Smithy-bot · 0 comments
Member

Follow-up from #534 comment / PR #592.

ChannelHelper.ResolveSendable was extracted for RssTimer. Reuse it (or extend the helper) in the other places that resolve a channel then check sendability.

Story Points:


Acceptance Criteria

GIVEN channel resolution logic exists in timers, commands, and events
WHEN those call sites need a sendable channel
THEN they use ChannelHelper (or an extended helper API) instead of duplicated cache/find/fetch + cast/isSendable logic

GIVEN name-based lookups (moderation / log / verification channels)
WHEN migrating them onto the helper
THEN either add a name-based resolve helper or migrate those configs to channel IDs first

Subtasks

  • Refactor src/timers/AutoKick.ts notice channel lookup (×2) onto ChannelHelper.ResolveSendable (id + sendable — closest match to current helper)
  • Refactor moderation audit channel lookup in src/commands/ban.ts
  • Refactor moderation audit channel lookup in src/commands/kick.ts
  • Refactor moderation audit channel lookup in src/commands/warn.ts
  • Refactor moderation audit channel lookup in src/commands/timeout.ts
  • Refactor log channel lookup in GuildMemberAdd
  • Refactor log channel lookup in GuildMemberRemove
  • Refactor log channel lookup in NicknameChanged
  • Refactor log channel lookup in MessageDelete
  • Refactor log channel lookup in MessageUpdate
  • Refactor verification channel lookup in VerificationCheck

Notes

  • Name-based lookups currently cast to TextChannel and would need a name-based helper or ID migration before they match ResolveSendable.
  • Prefer small PRs per subtask or grouped by area (AutoKick first; then moderation; then events; then verification).
Follow-up from [#534 comment](https://git.vylpes.xyz/RabbitLabs/vylbot-app/issues/534#issuecomment-24150) / PR #592. `ChannelHelper.ResolveSendable` was extracted for `RssTimer`. Reuse it (or extend the helper) in the other places that resolve a channel then check sendability. Story Points: --- ## Acceptance Criteria GIVEN channel resolution logic exists in timers, commands, and events WHEN those call sites need a sendable channel THEN they use `ChannelHelper` (or an extended helper API) instead of duplicated cache/find/fetch + cast/`isSendable` logic GIVEN name-based lookups (moderation / log / verification channels) WHEN migrating them onto the helper THEN either add a name-based resolve helper **or** migrate those configs to channel IDs first ## Subtasks - [ ] Refactor `src/timers/AutoKick.ts` notice channel lookup (×2) onto `ChannelHelper.ResolveSendable` (id + sendable — closest match to current helper) - [ ] Refactor moderation audit channel lookup in `src/commands/ban.ts` - [ ] Refactor moderation audit channel lookup in `src/commands/kick.ts` - [ ] Refactor moderation audit channel lookup in `src/commands/warn.ts` - [ ] Refactor moderation audit channel lookup in `src/commands/timeout.ts` - [ ] Refactor log channel lookup in `GuildMemberAdd` - [ ] Refactor log channel lookup in `GuildMemberRemove` - [ ] Refactor log channel lookup in `NicknameChanged` - [ ] Refactor log channel lookup in `MessageDelete` - [ ] Refactor log channel lookup in `MessageUpdate` - [ ] Refactor verification channel lookup in `VerificationCheck` ## Notes - Name-based lookups currently cast to `TextChannel` and would need a name-based helper or ID migration before they match `ResolveSendable`. - Prefer small PRs per subtask or grouped by area (AutoKick first; then moderation; then events; then verification).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
RabbitLabs/vylbot-app#593
No description provided.