# README
guildedgo
A guilded.gg library in Go
Getting started
go get github.com/itschip/guildedgo
Examples
Listen to events
package main
import (
"fmt"
"github.com/itschip/guildedgo"
)
func main() {
guildedClient := guildedgo.NewClient(&guildedgo.Config{
Token: "YOUR_TOKEN",
ServerID: "YOUR_SERVER_ID",
})
// Listen to the ChatMessageCreated event
guildedClient.On("ChatMessageCreated", func(client *guildedgo.Client, v any) {
data, ok := v.(*guildedgo.ChatMessageCreated)
if ok {
fmt.Println(data.Message.Content)
if data.Message.Content == "!ping" {
guildedClient.Channel.SendMessage(data.Message.ChannelID, &guildedgo.MessageObject{
Content: "pong!",
})
}
}
})
// Open socket
guildedClient.Open()
}
Command builder
serverID := internal.GetEnv("SERVER_ID")
token := internal.GetEnv("TOKEN")
config := &guildedgo.Config{
ServerID: serverID,
Token: token,
}
c := guildedgo.NewClient(config)
commands := &guildedgo.CommandsBuilder{
Commands: []Command{
{
CommandName: "!test",
Action: func(client *Client, v *ChatMessageCreated) {
client.Channel.SendMessage(v.Message.ChannelID, &MessageObject{
Content: "Test",
})
fmt.Println("Test working")
},
},
{
CommandName: "!party",
Action: func(client *Client, v *ChatMessageCreated) {
client.Channel.SendMessage(v.Message.ChannelID, &MessageObject{
Content: "Yeah!!! Let's party",
})
fmt.Println("Party working")
},
},
},
}
c.CommandService.AddCommands(commands)
c.Open()
# Packages
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ChatEmbed are rich content sections optionally associated with chat messages.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ChatMessage is the default message struct.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author