31 lines
520 B
Go
31 lines
520 B
Go
package main
|
|
|
|
import (
|
|
"github.com/Tnze/go-mc/bot"
|
|
"github.com/Tnze/go-mc/chat"
|
|
"github.com/bwmarrin/discordgo"
|
|
"github.com/google/uuid"
|
|
"github.com/rs/zerolog/log"
|
|
)
|
|
|
|
type Client struct {
|
|
discord *discordgo.Session
|
|
channel string
|
|
|
|
minecraft *bot.Client
|
|
}
|
|
|
|
func (c *Client) Run() error {
|
|
|
|
}
|
|
|
|
func (c *Client) onChatMsg(msg chat.Message, _ byte, _ uuid.UUID) error {
|
|
if c.discord != nil {
|
|
_, err := c.discord.ChannelMessageSend(c.channel, msg.Text)
|
|
return err
|
|
}
|
|
|
|
log.Info().Msg(msg.String())
|
|
return nil
|
|
}
|