Skip to content

Commit

Permalink
discord: send in-channel reply to !start
Browse files Browse the repository at this point in the history
  • Loading branch information
hrfee committed Jan 14, 2022
1 parent 5acee68 commit 8fd0978
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions discord.go
Expand Up @@ -302,6 +302,13 @@ func (d *DiscordDaemon) commandStart(s *dg.Session, m *dg.MessageCreate, lang st
}
user := d.MustGetUser(channel.ID, m.Author.ID, m.Author.Discriminator, m.Author.Username)
d.users[m.Author.ID] = user

_, err = d.bot.ChannelMessageSendReply(m.ChannelID, d.app.storage.lang.Telegram[lang].Strings.get("discordDMs"), m.MessageReference)
if err != nil {
d.app.err.Printf("Discord: Failed to send reply to \"%s\": %v", m.Author.Username, err)
return
}

content := d.app.storage.lang.Telegram[lang].Strings.get("startMessage") + "\n"
content += d.app.storage.lang.Telegram[lang].Strings.template("languageMessage", tmpl{"command": "!lang"})
_, err = s.ChannelMessageSend(channel.ID, content)
Expand Down
3 changes: 2 additions & 1 deletion lang/telegram/en-us.json
Expand Up @@ -7,6 +7,7 @@
"matrixStartMessage": "Hi\nEnter the below PIN in the Jellyfin sign-up page to verify your account.",
"invalidPIN": "That PIN was invalid, try again.",
"pinSuccess": "Success! You can now return to the sign-up page.",
"languageMessage": "Note: See available languages with {command}, and set language with {command} <language code>."
"languageMessage": "Note: See available languages with {command}, and set language with {command} <language code>.",
"discordDMs": "Please check your DMs for a response."
}
}

0 comments on commit 8fd0978

Please sign in to comment.