@@ -3,6 +3,7 @@ package secretsanta
3
3
import (
4
4
"cake4everybot/data/lang"
5
5
"cake4everybot/util"
6
+ "fmt"
6
7
7
8
"github.com/bwmarrin/discordgo"
8
9
)
@@ -15,9 +16,6 @@ func (c Component) handleInvite(ids []string) {
15
16
case "set_address" :
16
17
c .handleInviteSetAddress (ids )
17
18
return
18
- case "show_address" :
19
- c .handleInviteShowAddress (ids )
20
- return
21
19
default :
22
20
log .Printf ("Unknown component interaction ID: %s" , c .data .CustomID )
23
21
}
@@ -44,6 +42,16 @@ func (c Component) handleInviteShowMatch(ids []string) {
44
42
}
45
43
46
44
e := util .AuthoredEmbed (c .Session , player .Match .Member , tp + "display" )
45
+ e .Title = fmt .Sprintf (lang .GetDefault (tp + "msg.invite.show_match.title" ), player .Match .Member .DisplayName ())
46
+ e .Description = lang .GetDefault (tp + "msg.invite.show_match.description" )
47
+ e .Fields = append (e .Fields , & discordgo.MessageEmbedField {
48
+ Name : lang .GetDefault (tp + "msg.invite.show_match.address" ),
49
+ Value : fmt .Sprintf ("```\n %s\n ```" , player .Match .Address ),
50
+ })
51
+ if player .Match .Address == "" {
52
+ log .Printf ("%s has no address set: %+v" , player .Match .Member .DisplayName (), player .Match )
53
+ e .Fields [0 ].Value = lang .GetDefault (tp + "msg.invite.show_match.address_not_set" )
54
+ }
47
55
48
56
util .SetEmbedFooter (c .Session , tp + "display" , e )
49
57
c .ReplyHiddenEmbed (e )
@@ -86,7 +94,3 @@ func (c Component) handleInviteSetAddress(ids []string) {
86
94
},
87
95
}})
88
96
}
89
-
90
- func (c Component ) handleInviteShowAddress (ids []string ) {
91
-
92
- }
0 commit comments