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

Compare commits

..

3 Commits

Author SHA1 Message Date
Violet Scheen
19f466c1b7
Merge 70afc21217 into 9c771e193e 2023-10-10 16:00:35 -04:00
Violet Scheen
70afc21217
Merge branch 'hrfee:main' into main 2023-10-10 13:51:51 -04:00
Violet Scheen
525c13ff6a
Update discord.go 2023-10-10 12:55:56 -04:00

View File

@ -586,11 +586,9 @@ func (d *DiscordDaemon) cmdInvite(s *dg.Session, i *dg.InteractionCreate, lang s
}*/
invite.ValidTill = validTill
if invuser != "" && d.app.config.Section("invite_emails").Key("enabled").MustBool(false) {
discord := ""
d.app.debug.Printf("%s: Sending invite message", inviteCode)
invname, err := d.bot.GuildMember(d.guildID, invuser)
invite.SendTo = invname.User.Username
msg, err := d.app.email.constructInvite(inviteCode, invite, d.app, false)
if err != nil {
invite.SendTo = fmt.Sprintf("Failed to send to %s", invuser)
@ -598,7 +596,7 @@ func (d *DiscordDaemon) cmdInvite(s *dg.Session, i *dg.InteractionCreate, lang s
//add response message
} else {
var err error
err = d.app.discord.SendDM(msg, discord)
err = d.app.discord.SendDM(msg, invuser)
if err != nil {
invite.SendTo = fmt.Sprintf("Failed to send to %s", invuser)
d.app.err.Printf("%s: %s: %v", inviteCode, invite.SendTo, err)