discord

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

togo

togo-framework/bot-discord

marketplace pkg.go.dev MIT

Discord driver for the togo bot subsystem.

Install

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:
    BOT_DRIVER=discord
    DISCORD_BOT_TOKEN=...
    

Blank-import the driver next to the base:

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


Premium sponsors

ID8 Media  ·  One Studio

Support togo — become a sponsor.

Documentation

Overview

Package discord is the Discord driver for togo's bot subsystem. Blank-import it alongside github.com/togo-framework/bot and set BOT_DRIVER=discord plus DISCORD_BOT_TOKEN to run a Discord bot.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL