@@ -31,6 +31,15 @@ var scheduleHandler = map[string]func(ctx *internal.BotContext, s *discordgo.Ses
3131func Schedule (ctx * internal.BotContext , s * discordgo.Session , i * discordgo.InteractionCreate ) {
3232 config := ctx .Config
3333
34+ footer := & discordgo.MessageEmbedFooter {Text : "Requested by Unknown" }
35+ if i .Member != nil {
36+ footer .Text = "Requested by " + i .Member .DisplayName ()
37+ footer .IconURL = i .Member .AvatarURL ("" )
38+ } else if i .User != nil {
39+ footer .Text = "Requested by " + i .User .Username
40+ footer .IconURL = i .User .AvatarURL ("" )
41+ }
42+
3443 if i .GuildID == "" {
3544 s .InteractionRespond (i .Interaction , & discordgo.InteractionResponse {
3645 Type : discordgo .InteractionResponseChannelMessageWithSource ,
@@ -40,10 +49,7 @@ func Schedule(ctx *internal.BotContext, s *discordgo.Session, i *discordgo.Inter
4049 Title : "エラー" ,
4150 Description : "このコマンドはサーバー内でのみ使用できます。" ,
4251 Color : config .Colors .Error ,
43- Footer : & discordgo.MessageEmbedFooter {
44- Text : "Requested by " + i .Member .DisplayName (),
45- IconURL : i .Member .AvatarURL ("" ),
46- },
52+ Footer : footer ,
4753 Timestamp : time .Now ().Format (time .RFC3339 ),
4854 },
4955 },
@@ -63,10 +69,7 @@ func Schedule(ctx *internal.BotContext, s *discordgo.Session, i *discordgo.Inter
6369 Title : "エラー" ,
6470 Description : "このコマンドを実行する権限がありません。" ,
6571 Color : config .Colors .Error ,
66- Footer : & discordgo.MessageEmbedFooter {
67- Text : "Requested by " + i .Member .DisplayName (),
68- IconURL : i .Member .AvatarURL ("" ),
69- },
72+ Footer : footer ,
7073 Timestamp : time .Now ().Format (time .RFC3339 ),
7174 },
7275 },
@@ -90,10 +93,7 @@ func Schedule(ctx *internal.BotContext, s *discordgo.Session, i *discordgo.Inter
9093 Title : "エラー" ,
9194 Description : "不明なサブコマンドです。" ,
9295 Color : config .Colors .Error ,
93- Footer : & discordgo.MessageEmbedFooter {
94- Text : "Requested by " + i .Member .DisplayName (),
95- IconURL : i .Member .AvatarURL ("" ),
96- },
96+ Footer : footer ,
9797 Timestamp : time .Now ().Format (time .RFC3339 ),
9898 },
9999 },
0 commit comments