1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-11-13 22:00:10 +00:00

Compare commits

...

3 Commits

Author SHA1 Message Date
8fd097836f
discord: send in-channel reply to !start 2022-01-14 17:26:19 +00:00
5acee68987
settings: rename URL base to reverse proxy subfolder 2022-01-14 17:04:17 +00:00
25a1ca5a9f
bots: fix language selection
you may have to re-apply your language choice.
2022-01-14 17:01:42 +00:00
4 changed files with 13 additions and 4 deletions

4
api.go
View File

@ -2092,7 +2092,9 @@ func (app *appContext) ModifyConfig(gc *gin.Context) {
if section == "email" && setting == "method" && value == "disabled" { if section == "email" && setting == "method" && value == "disabled" {
value = "" value = ""
} }
if value.(string) != app.config.Section(section).Key(setting).MustString("") { if (section == "discord" || section == "matrix") && setting == "language" {
tempConfig.Section("telegram").Key("language").SetValue(value.(string))
} else if value.(string) != app.config.Section(section).Key(setting).MustString("") {
tempConfig.Section(section).Key(setting).SetValue(value.(string)) tempConfig.Section(section).Key(setting).SetValue(value.(string))
} }
} }

View File

@ -250,7 +250,7 @@
"description": "Displayed when a user creates an account" "description": "Displayed when a user creates an account"
}, },
"url_base": { "url_base": {
"name": "URL Base", "name": "Reverse Proxy subfolder",
"required": false, "required": false,
"requires_restart": true, "requires_restart": true,
"type": "text", "type": "text",

View File

@ -122,7 +122,6 @@ func (d *DiscordDaemon) ListRoles() (roles [][2]string, err error) {
return return
} }
for _, role := range r { for _, role := range r {
fmt.Println(d.username)
if role.Name != d.username && role.Name != "@everyone" { if role.Name != d.username && role.Name != "@everyone" {
roles = append(roles, [2]string{role.ID, role.Name}) roles = append(roles, [2]string{role.ID, role.Name})
} }
@ -303,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) user := d.MustGetUser(channel.ID, m.Author.ID, m.Author.Discriminator, m.Author.Username)
d.users[m.Author.ID] = user 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.get("startMessage") + "\n"
content += d.app.storage.lang.Telegram[lang].Strings.template("languageMessage", tmpl{"command": "!lang"}) content += d.app.storage.lang.Telegram[lang].Strings.template("languageMessage", tmpl{"command": "!lang"})
_, err = s.ChannelMessageSend(channel.ID, content) _, err = s.ChannelMessageSend(channel.ID, content)

View File

@ -7,6 +7,7 @@
"matrixStartMessage": "Hi\nEnter the below PIN in the Jellyfin sign-up page to verify your account.", "matrixStartMessage": "Hi\nEnter the below PIN in the Jellyfin sign-up page to verify your account.",
"invalidPIN": "That PIN was invalid, try again.", "invalidPIN": "That PIN was invalid, try again.",
"pinSuccess": "Success! You can now return to the sign-up page.", "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."
} }
} }