Skip to content

Commit

Permalink
Fallback to adorable avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
qaisjp committed Aug 16, 2017
1 parent a832cef commit 8593484
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bridge/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,17 @@ func (h *home) loop() {
continue
}

avatar := h.discord.GetAvatar(mapping.GuildID, msg.Username)
if avatar == "" {
// If we don't have a Discord avatar, generate an adorable avatar
avatar = "https://api.adorable.io/avatars/128/" + msg.Username
}

// TODO: What if it takes a long time? wait=true below.
err := h.discord.WebhookExecute(mapping.ID, mapping.Token, true, &discordgo.WebhookParams{
Content: msg.Message,
Username: msg.Username,
AvatarURL: h.discord.GetAvatar(mapping.GuildID, msg.Username),
AvatarURL: avatar,
})

if err != nil {
Expand Down

0 comments on commit 8593484

Please sign in to comment.