Documentation ¶
Overview ¶
Package irc implements an irc-discord bridge.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
A Bot represents an IRC-Discord bot.
Example ¶
b, err := New( Host("irc.example.com:6697"), TLS(true), Nick("discord"), Token("<discord bot token>"), Sync(Channel("#irc-channel"), Discord("#discord-channel", "<discord webhook URL>")), Relay(Discord("#discord-channel", "<discord webhook URL>"), Channel("#irc-read-only-channel")), Relay(Channel("#irc-channel"), Discord("#discord-read-only-channel", "<discord webhook URL>")), // ... ) if err != nil { log.Fatal(err) } defer b.Close() log.Printf("IRC-Discord bridge running - press CTRL-C to exit") sc := make(chan os.Signal, 1) signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill) <-sc
Output:
type ChannelDiscord ¶ added in v1.0.10
type ChannelDiscord struct {
// contains filtered or unexported fields
}
ChannelDiscord represents a configured Discord channel with Discord().
func Discord ¶ added in v1.0.5
func Discord(channel string, webhook string) *ChannelDiscord
Discord configures a Discord channel with a webhook.
type ChannelIRC ¶ added in v1.0.10
type ChannelIRC struct {
// contains filtered or unexported fields
}
ChannelIRC represents a configured IRC channel with Channel().
type Option ¶
An Option configures a Bot in New.
func Relay ¶ added in v1.0.5
func Relay(from, to interface{}) Option
Relay configures a relay from either IRC channel or Discord channel to the other. To have it both ways, use twice or use the Sync shortcut.
func Sync ¶ added in v1.0.5
func Sync(irc *ChannelIRC, discord *ChannelDiscord) Option
Sync an IRC channel with a Discord channel.
Click to show internal directories.
Click to hide internal directories.