Milen/db/reactRole.go

25 lines
431 B
Go

package db
type ReactRole struct {
MessageID string
EmojiID string
RoleID string
}
func CreateReactRole(messageID, emojiID, roleID string) {
db.Create(&ReactRole{
MessageID: messageID,
EmojiID: emojiID,
RoleID: roleID,
})
}
func GetReactRole(messageID, emojiID string) string {
result := ReactRole{
MessageID: messageID,
EmojiID: emojiID,
}
db.Where(&result).First(&result)
return result.RoleID
}