dashboard-v2/messagequeue/ticketclose.go
2020-05-11 18:49:07 +01:00

31 lines
540 B
Go

package messagequeue
import (
"encoding/json"
"github.com/apex/log"
)
type TicketCloseMessage struct {
GuildId uint64
TicketId int
User uint64
Reason string
}
func (c *RedisClient) PublishTicketClose(guildId uint64, ticketId int, userId uint64, reason string) {
settings := TicketCloseMessage{
GuildId: guildId,
TicketId: ticketId,
User: userId,
Reason: reason,
}
encoded, err := json.Marshal(settings)
if err != nil {
log.Error(err.Error())
return
}
c.Publish("tickets:close", string(encoded))
}