dcbot/internal/discord/discord.go
Dawid Wysokiński 6415b162de
All checks were successful
continuous-integration/drone/push Build is passing
feat: errors - i18n (#111)
Reviewed-on: #111
2023-06-27 12:00:35 +00:00

33 lines
463 B
Go

package discord
import (
"fmt"
"time"
)
const (
embedDescriptionCharLimit = 4096
)
func formatTimestamp(t time.Time) string {
return t.Format(time.RFC3339)
}
func buildLink(text string, url string) string {
if url == "" {
return text
}
return fmt.Sprintf("[`%s`](%s)", text, url)
}
func buildChannelMention(id string) string {
return "<#" + id + ">"
}
func boolToEmoji(val bool) string {
if val {
return ":white_check_mark:"
}
return ":x:"
}