Skip to content

Unify duplicate TelegramNotifier and DiscordNotifier interfaces #15

@msoedov

Description

@msoedov

internal/handlers/api.go:23-31 -- TelegramNotifier and DiscordNotifier define identical method sets:

  • SendWorkBlockApproval(blockID, title, goal, transition string) error
  • SendMessage(text string) error

Both telegram.Bot and discord.Notifier already satisfy either interface interchangeably.

Proposal:

  • Replace both with a single Notifier interface in api.go
  • Change the API struct to hold notifiers []Notifier instead of separate telegram and discord fields
  • Update cmd/secondorder/main.go initialization accordingly

Files affected: internal/handlers/api.go, cmd/secondorder/main.go, internal/telegram/bot.go, internal/discord/webhook.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions