Marketplace

Discord Bot

Other

Discord bot driver (gateway).

togo-framework
bash
togo install togo-framework/bot-discord

Install

bash
togo install togo-framework/bot
togo install togo-framework/bot-discord

The Discord driver for togo's bot subsystem, built on discordgo. It opens a gateway connection and dispatches each message to the bot command/message handlers you register once with bot.OnCommand / bot.OnMessage.

Configure

  1. Create an application + bot at the Discord Developer Portal, copy the Bot Token.
  2. Enable the Message Content Intent (Bot → Privileged Gateway Intents).
  3. Invite the bot to your server with the bot scope.
  4. Set env:
    bash
    BOT_DRIVER=discord
    DISCORD_BOT_TOKEN=...

Blank-import the driver next to the base:

go
import (
	_ "github.com/togo-framework/bot"
	_ "github.com/togo-framework/bot-discord"
)

m.Channel is the Discord channel ID; Service.Send(ctx, channel, msg) posts to it. The bot ignores its own and other bots' messages to avoid loops.

License

MIT © togo-framework


<div align="center"> <h3>Premium sponsors</h3> <p> <a href="https://id8media.com"><strong>ID8 Media</strong></a> &nbsp;·&nbsp; <a href="https://one-studio.co"><strong>One Studio</strong></a> </p> <p><sub>Support togo — <a href="https://github.com/sponsors/fadymondy">become a sponsor</a>.</sub></p> </div>