2022-09-09 22:24:04 +02:00
|
|
|
package util
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"math/rand"
|
2022-09-13 17:46:40 +02:00
|
|
|
"os"
|
2022-09-09 22:24:04 +02:00
|
|
|
"strings"
|
2022-09-13 17:46:40 +02:00
|
|
|
//"github.com/fatih/color"
|
2022-09-09 22:24:04 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var uwuEmotes = [15]string{
|
|
|
|
"owo",
|
|
|
|
"UwU",
|
|
|
|
">w<",
|
|
|
|
"^w^",
|
|
|
|
"●w●",
|
|
|
|
"☆w☆",
|
|
|
|
"𝗨𝘄𝗨",
|
|
|
|
"(´꒳`)",
|
|
|
|
"♥(。U ω U。)",
|
|
|
|
"(˘ε˘)",
|
|
|
|
"( ˘ᴗ˘ )",
|
|
|
|
"(*ฅ́˘ฅ̀*)",
|
|
|
|
"*screams*",
|
2022-09-13 17:46:40 +02:00
|
|
|
"*twerks*",
|
2022-09-09 22:24:04 +02:00
|
|
|
"*sweats*",
|
|
|
|
}
|
|
|
|
|
|
|
|
var logoIndex = 0
|
|
|
|
var isInProgressLine = false
|
|
|
|
var logo = ` /\
|
|
|
|
/ \
|
|
|
|
/\ \
|
|
|
|
/ > ω <\
|
|
|
|
/ __ \
|
|
|
|
/ __| |__-\
|
|
|
|
/_-'' ''-_\
|
|
|
|
`
|
|
|
|
var logoLines []string
|
|
|
|
var logoWidth int
|
|
|
|
var shouldUwuify = true
|
|
|
|
|
|
|
|
func InitUwuPrinter() {
|
|
|
|
logoLines = strings.Split(logo, "\n")
|
|
|
|
logoWidth = 0
|
|
|
|
for _, v := range logoLines {
|
|
|
|
lineLength := len([]rune(v))
|
|
|
|
if lineLength > logoWidth {
|
|
|
|
logoWidth = lineLength
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func initLine() {
|
|
|
|
if !isInProgressLine {
|
|
|
|
isInProgressLine = true
|
|
|
|
if logoIndex < len(logoLines) {
|
|
|
|
logoLine := logoLines[logoIndex]
|
|
|
|
logoLineLength := len([]rune(logoLine))
|
|
|
|
padding := strings.Repeat(" ", logoWidth-logoLineLength)
|
2022-09-10 08:31:27 +02:00
|
|
|
print(logoLine, padding)
|
2022-09-09 22:24:04 +02:00
|
|
|
logoIndex += 1
|
|
|
|
} else {
|
2022-09-10 08:31:27 +02:00
|
|
|
print(strings.Repeat(" ", logoWidth))
|
2022-09-09 22:24:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-11 13:55:08 +02:00
|
|
|
func UwuPrint(message string, noUwuOverride bool, whole string) {
|
2022-09-10 08:31:27 +02:00
|
|
|
//will add color eventually, my brain hurts
|
2022-09-11 13:55:08 +02:00
|
|
|
var hadAnyContent bool
|
|
|
|
var wholeword string
|
|
|
|
var checkspaces int
|
|
|
|
isuwu := true
|
2022-09-09 22:24:04 +02:00
|
|
|
initLine()
|
2022-09-13 17:46:40 +02:00
|
|
|
if noUwuOverride || !shouldUwuify || (len(os.Args) > 1 && os.Args[1] == "nouwu") {
|
2022-09-11 13:55:08 +02:00
|
|
|
isuwu = false
|
|
|
|
wholeword = message
|
2022-09-09 22:24:04 +02:00
|
|
|
}
|
2022-09-11 13:55:08 +02:00
|
|
|
notuwuified := ""
|
|
|
|
if isuwu {
|
|
|
|
words := strings.Split(message, " ")
|
|
|
|
hadAnyContent = false
|
|
|
|
for _, word := range words {
|
|
|
|
notuwuified += word
|
|
|
|
if word == "" {
|
|
|
|
checkspaces += 1
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
word = strings.ReplaceAll(word, "r", "w")
|
|
|
|
word = strings.ReplaceAll(word, "i", "iy")
|
|
|
|
word = strings.ReplaceAll(word, "iyy", "iy")
|
|
|
|
word = strings.ReplaceAll(word, "l", "w")
|
2022-09-09 22:24:04 +02:00
|
|
|
|
2022-09-11 13:55:08 +02:00
|
|
|
if strings.HasSuffix(word, "!") {
|
|
|
|
word = word[:len(word)-1] + "1!11!1"
|
|
|
|
}
|
2022-09-09 22:24:04 +02:00
|
|
|
|
2022-09-11 13:55:08 +02:00
|
|
|
if strings.Contains(word, "u") &&
|
|
|
|
!strings.Contains(word, "uwu") &&
|
|
|
|
!strings.Contains(word, "owo") {
|
|
|
|
word = strings.ReplaceAll(word, "u", "uwu")
|
|
|
|
}
|
|
|
|
hadAnyContent = true
|
|
|
|
wholeword += word
|
2022-09-09 22:24:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if hadAnyContent && rand.Intn(5) == 0 {
|
2022-09-13 17:46:40 +02:00
|
|
|
print(uwuEmotes[rand.Intn(len(uwuEmotes))] + " ")
|
2022-09-09 22:24:04 +02:00
|
|
|
}
|
2022-09-11 13:55:08 +02:00
|
|
|
wholeword = wholeword + strings.Repeat(" ", checkspaces)
|
|
|
|
|
2022-09-13 17:46:40 +02:00
|
|
|
handlecolor(wholeword)
|
2022-09-11 13:55:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func handlecolor(wholeword string) {
|
2022-09-13 17:46:40 +02:00
|
|
|
print(wholeword)
|
2022-09-09 22:24:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func UwuNewline() {
|
|
|
|
initLine()
|
|
|
|
isInProgressLine = false
|
|
|
|
fmt.Println()
|
|
|
|
}
|
|
|
|
|
|
|
|
func UwuPrintRest() {
|
|
|
|
for logoIndex < len(logoLines) {
|
|
|
|
UwuNewline()
|
|
|
|
}
|
|
|
|
}
|