Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Commit e1756a8

Browse files
committed
format
1 parent 27d9676 commit e1756a8

File tree

4 files changed

+21
-17
lines changed

4 files changed

+21
-17
lines changed

components/main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ func (theme Theme) MessageComponent(msg discord.Message, previousMsg discord.Mes
110110
href := discord.EmojiURL(emojiId, format)
111111
content = content[:loc[0]] + tools.ParseTemplate(theme.EMOJI_WRAPPER, map[string]string{
112112
"CONTENT": tools.ParseTemplate(theme.CUSTOM_EMOJI, map[string]string{
113-
"URL": href,
113+
"URL": href,
114114
"CSS_CLASSES": cssClassses,
115115
}),
116-
}) + content[loc[1]:]
116+
}) + content[loc[1]:]
117117
}
118118

119119
for _, attach := range msg.Attachments {
@@ -168,19 +168,19 @@ func (theme Theme) MessageComponent(msg discord.Message, previousMsg discord.Mes
168168
} else {
169169
emojiStr = tools.ParseTemplate(theme.CUSTOM_EMOJI, map[string]string{
170170
"CSS_CLASSES": "reaction-emoji",
171-
"URL": discord.EmojiURL(reaction.Emoji.ID, "webp"),
171+
"URL": discord.EmojiURL(reaction.Emoji.ID, "webp"),
172172
})
173173
}
174174
reactions += tools.ParseTemplate(theme.REACTION, map[string]string{
175175
"EMOJI": emojiStr,
176176
"COUNT": fmt.Sprint(reaction.Count),
177177
})
178178
}
179-
179+
180180
reactions = tools.ParseTemplate(theme.REACTION_WRAPPER, map[string]string{
181181
"CONTENT": reactions,
182182
})
183-
183+
184184
for _, mention := range msg.Mentions {
185185
idReg := regexp.MustCompile(fmt.Sprintf(`<@!?%v>`, mention.ID))
186186
content = idReg.ReplaceAllString(content, tools.ParseTemplate(theme.MENTION, map[string]string{
@@ -210,7 +210,7 @@ func (theme Theme) MessageComponent(msg discord.Message, previousMsg discord.Mes
210210
"REPLY_CONTENT": replyContent,
211211
"STICKER_CONTENT": stickerContent,
212212
"GIFS": gifContents,
213-
"REACTIONS": reactions,
213+
"REACTIONS": reactions,
214214
})
215215
} else {
216216
return tools.ParseTemplate(theme.MSG, map[string]string{
@@ -220,7 +220,7 @@ func (theme Theme) MessageComponent(msg discord.Message, previousMsg discord.Mes
220220
"ID": msg.ID,
221221
"STICKER_CONTENT": stickerContent,
222222
"GIFS": gifContents,
223-
"REACTIONS": reactions,
223+
"REACTIONS": reactions,
224224
})
225225
}
226226
}

config/autoTools.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,24 +79,28 @@ func (mask HeadersMask) PullBuildId() string {
7979
resp, err := io.ReadAll(respRaw.Body)
8080
tools.PanicIfErr(err)
8181
assets := discordAssetReg.FindAll(resp, 200)
82-
82+
8383
foundNumber := ""
8484

8585
for _, asset := range assets[len(assets)-7:] {
8686
buildFileRaw, err := http.Get(fmt.Sprintf("https://%vdiscord.com/%v", mask.DomainPrefix, string(asset)))
8787
tools.PanicIfErr(err)
8888
buildFile, err := io.ReadAll(buildFileRaw.Body)
8989
tools.PanicIfErr(err)
90-
90+
9191
buildFileS := buildFile
9292

9393
buildLoc := buildNumReg.FindIndex(buildFileS)
94-
94+
9595
if len(buildLoc) != 0 {
9696
outLoc := buildNumVReg.FindIndex(buildFileS[buildLoc[1]:])
97-
if len(outLoc) == 0 {continue}
98-
if outLoc[0] > 20 {continue}
99-
out := buildFileS[buildLoc[1]+outLoc[0]:buildLoc[1]+outLoc[1]]
97+
if len(outLoc) == 0 {
98+
continue
99+
}
100+
if outLoc[0] > 20 {
101+
continue
102+
}
103+
out := buildFileS[buildLoc[1]+outLoc[0] : buildLoc[1]+outLoc[1]]
100104
foundNumber = string(out)
101105
break
102106
}

discord/smallTools.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ func (attachment Attachment) MediaName() string {
6262

6363
func EmojiURL(id string, format string) string {
6464
return fmt.Sprintf("https://cdn.discordapp.com/emojis/%v.%v?size=96&quality=lossless", id, format)
65-
}
65+
}

discord/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ type ReplyMsg struct {
7070

7171
type Reaction struct {
7272
Emoji Emoji `json:"emoji"`
73-
Count int `json:"count"`
73+
Count int `json:"count"`
7474
}
7575

7676
type Emoji struct {
77-
ID string `json:"id"`
77+
ID string `json:"id"`
7878
Name string `json:"name"`
7979
}
8080

@@ -89,7 +89,7 @@ type Message struct {
8989
Timestamp int `json:"timestamp"`
9090
Type MsgType `json:"type"`
9191
Stickers []Sticker `json:"sticker_items"`
92-
Reactions []Reaction `json:"reactions"`
92+
Reactions []Reaction `json:"reactions"`
9393
IsEdited bool
9494
IsReply bool
9595
IsSystemType bool

0 commit comments

Comments
 (0)