Compare commits
7 Commits
e98c9b46f1
...
035dbde819
Author | SHA1 | Date | |
---|---|---|---|
035dbde819 | |||
c373d8b2d6 | |||
8698c3c6a4 | |||
0edd2ba68b | |||
b91f0b5a18 | |||
24fa841c0d | |||
44558b8109 |
@ -76,6 +76,10 @@ func (d *DiscordDaemon) run() {
|
||||
d.app.err.Printf("Discord: Failed to start daemon: %v", err)
|
||||
return
|
||||
}
|
||||
// Sometimes bot.State isn't populated quick enough
|
||||
for d.bot.State == nil {
|
||||
continue
|
||||
}
|
||||
d.username = d.bot.State.User.Username
|
||||
// Choose the last guild (server), for now we don't really support multiple anyway
|
||||
guild, err := d.bot.Guild(d.bot.State.Guilds[len(d.bot.State.Guilds)-1].ID)
|
||||
|
BIN
images/discord/1.jpg
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
images/discord/2.jpg
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
images/discord/3.jpg
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
images/discord/4.jpg
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
images/discord/5.jpg
Normal file
After Width: | Height: | Size: 92 KiB |
BIN
images/discord/6.jpg
Normal file
After Width: | Height: | Size: 85 KiB |
BIN
images/discord/7.jpg
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
images/discord/8.jpg
Normal file
After Width: | Height: | Size: 58 KiB |
10
stripmd.go
@ -44,6 +44,16 @@ func StripAltText(md string, links bool) (string, []*dg.MessageEmbed) {
|
||||
out += md[URLStart : URLEnd+1]
|
||||
}
|
||||
previousURLEnd = URLEnd
|
||||
// Removing links often leaves a load of extra newlines which look weird, this removes them.
|
||||
if links {
|
||||
next := 2
|
||||
for md[URLEnd+next] == '\n' {
|
||||
next++
|
||||
}
|
||||
if next >= 3 {
|
||||
previousURLEnd += next - 2
|
||||
}
|
||||
}
|
||||
altTextStart, URLStart, URLEnd = -1, -1, -1
|
||||
continue
|
||||
}
|
||||
|