let admins reset default emojis
This commit is contained in:
parent
5bfc5e3e40
commit
32bd1a5e28
|
@ -66,6 +66,7 @@ func init() {
|
|||
var emojis map[string]string
|
||||
|
||||
type emojiHolder struct {
|
||||
NoDefault bool `json:"no_defaults"`
|
||||
Emojis []map[string]string `json:"emojis"`
|
||||
}
|
||||
|
||||
|
@ -77,17 +78,22 @@ func InitEmoji() error {
|
|||
}
|
||||
|
||||
emojis = make(map[string]string, len(emoji.Emojis))
|
||||
if !emoji.NoDefault {
|
||||
for _, item := range emoji.Emojis {
|
||||
for ikey, ival := range item {
|
||||
emojis[ikey] = ival
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emoji = emojiHolder{}
|
||||
err = unmarshalJsonFileIgnore404("./config/emoji.json", &emoji)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if emoji.NoDefault {
|
||||
emojis = make(map[string]string)
|
||||
}
|
||||
|
||||
for _, item := range emoji.Emojis {
|
||||
for ikey, ival := range item {
|
||||
|
|
Loading…
Reference in New Issue