mirror of
https://github.com/hrfee/jfa-go.git
synced 2025-01-01 05:50:12 +00:00
Compare commits
1 Commits
19f466c1b7
...
d60d347458
Author | SHA1 | Date | |
---|---|---|---|
|
d60d347458 |
@ -586,9 +586,11 @@ func (d *DiscordDaemon) cmdInvite(s *dg.Session, i *dg.InteractionCreate, lang s
|
|||||||
}*/
|
}*/
|
||||||
invite.ValidTill = validTill
|
invite.ValidTill = validTill
|
||||||
if invuser != "" && d.app.config.Section("invite_emails").Key("enabled").MustBool(false) {
|
if invuser != "" && d.app.config.Section("invite_emails").Key("enabled").MustBool(false) {
|
||||||
|
discord := ""
|
||||||
d.app.debug.Printf("%s: Sending invite message", inviteCode)
|
d.app.debug.Printf("%s: Sending invite message", inviteCode)
|
||||||
invname, err := d.bot.GuildMember(d.guildID, invuser)
|
invname, err := d.bot.GuildMember(d.guildID, invuser)
|
||||||
invite.SendTo = invname.User.Username
|
invite.SendTo = invname.User.Username
|
||||||
|
|
||||||
msg, err := d.app.email.constructInvite(inviteCode, invite, d.app, false)
|
msg, err := d.app.email.constructInvite(inviteCode, invite, d.app, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
invite.SendTo = fmt.Sprintf("Failed to send to %s", invuser)
|
invite.SendTo = fmt.Sprintf("Failed to send to %s", invuser)
|
||||||
@ -596,7 +598,7 @@ func (d *DiscordDaemon) cmdInvite(s *dg.Session, i *dg.InteractionCreate, lang s
|
|||||||
//add response message
|
//add response message
|
||||||
} else {
|
} else {
|
||||||
var err error
|
var err error
|
||||||
err = d.app.discord.SendDM(msg, invuser)
|
err = d.app.discord.SendDM(msg, discord)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
invite.SendTo = fmt.Sprintf("Failed to send to %s", invuser)
|
invite.SendTo = fmt.Sprintf("Failed to send to %s", invuser)
|
||||||
d.app.err.Printf("%s: %s: %v", inviteCode, invite.SendTo, err)
|
d.app.err.Printf("%s: %s: %v", inviteCode, invite.SendTo, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user