Support emoji :D
This commit is contained in:
parent
990e0dd50a
commit
fe59d61d76
7
main.go
7
main.go
@ -3,6 +3,9 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/kyokomi/emoji"
|
||||||
)
|
)
|
||||||
|
|
||||||
var emoticons map[string]string
|
var emoticons map[string]string
|
||||||
@ -13,12 +16,14 @@ func main() {
|
|||||||
emt := "¯\\_(ツ)_/¯"
|
emt := "¯\\_(ツ)_/¯"
|
||||||
if len(os.Args) > 1 {
|
if len(os.Args) > 1 {
|
||||||
which := os.Args[1]
|
which := os.Args[1]
|
||||||
fmt.Println(which)
|
|
||||||
if which == "help" {
|
if which == "help" {
|
||||||
for k, v := range emoticons {
|
for k, v := range emoticons {
|
||||||
fmt.Println(k, v)
|
fmt.Println(k, v)
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
} else if which == "emoji" {
|
||||||
|
rest := strings.Join(os.Args[2:], " ")
|
||||||
|
emt = emoji.Sprint(rest)
|
||||||
} else {
|
} else {
|
||||||
if i, ok := emoticons[which]; ok {
|
if i, ok := emoticons[which]; ok {
|
||||||
emt = i
|
emt = i
|
||||||
|
Loading…
Reference in New Issue
Block a user