idk
This commit is contained in:
parent
ed40cf2e89
commit
a2a08fa60a
@ -53,6 +53,16 @@ func Run(BotToken string) {
|
|||||||
var solutionlength string
|
var solutionlength string
|
||||||
switch data.Name {
|
switch data.Name {
|
||||||
case "solve-maze":
|
case "solve-maze":
|
||||||
|
err = s.InteractionRespond(
|
||||||
|
i.Interaction,
|
||||||
|
&discordgo.InteractionResponse{
|
||||||
|
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
||||||
|
Data: &discordgo.InteractionResponseData{
|
||||||
|
Flags: 1 << 6,
|
||||||
|
Content: responseData,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
messageUrl := i.ApplicationCommandData().Options[0].Value.(string);
|
messageUrl := i.ApplicationCommandData().Options[0].Value.(string);
|
||||||
if strings.Contains(messageUrl, "media.discordapp.net") {
|
if strings.Contains(messageUrl, "media.discordapp.net") {
|
||||||
messageUrl = strings.Replace(messageUrl, "media.discordapp.net", "cdn.discordapp.com", 1)
|
messageUrl = strings.Replace(messageUrl, "media.discordapp.net", "cdn.discordapp.com", 1)
|
||||||
@ -97,17 +107,15 @@ func Run(BotToken string) {
|
|||||||
fileName := "/tmp/outputmaze.png"
|
fileName := "/tmp/outputmaze.png"
|
||||||
f, _ := os.Open(fileName)
|
f, _ := os.Open(fileName)
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
err = s.InteractionRespond(
|
_, err = s.FollowupMessageCreate(
|
||||||
i.Interaction,
|
i.Interaction,
|
||||||
&discordgo.InteractionResponse{
|
false,
|
||||||
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
&discordgo.WebhookParams{
|
||||||
Data: &discordgo.InteractionResponseData{
|
|
||||||
Content: "Length of solution is: " + solutionlength,
|
Content: "Length of solution is: " + solutionlength,
|
||||||
Files: []*discordgo.File{
|
Files: []*discordgo.File{
|
||||||
&discordgo.File{
|
&discordgo.File{
|
||||||
Name: fileName,
|
Name: fileName,
|
||||||
Reader: f,
|
Reader: f,
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -121,14 +129,12 @@ func Run(BotToken string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if responseData != "" {
|
if responseData != "" {
|
||||||
err = s.InteractionRespond(
|
_, err = s.FollowupMessageCreate(
|
||||||
i.Interaction,
|
i.Interaction,
|
||||||
&discordgo.InteractionResponse{
|
false,
|
||||||
Type: discordgo.InteractionResponseChannelMessageWithSource,
|
&discordgo.WebhookParams{
|
||||||
Data: &discordgo.InteractionResponseData{
|
|
||||||
Flags: 1 << 6,
|
Flags: 1 << 6,
|
||||||
Content: responseData,
|
Content: responseData,
|
||||||
},
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user