added partial userinstall support

This commit is contained in:
2024-04-10 18:15:08 +02:00
parent 99617e5e1f
commit bb9c616844
11 changed files with 120 additions and 70 deletions

View File

@@ -10,6 +10,15 @@ var cmd_dadjoke = Command{
Definition: discord.SlashCommandCreate{
Name: "dadjoke",
Description: "Gives you a random joke that is as bad as your dad would tell them",
Contexts: []discord.InteractionContextType{
discord.InteractionContextTypeGuild,
discord.InteractionContextTypePrivateChannel,
discord.InteractionContextTypeBotDM,
},
IntegrationTypes: []discord.ApplicationIntegrationType{
discord.ApplicationIntegrationTypeGuildInstall,
discord.ApplicationIntegrationTypeUserInstall,
},
},
Interact: func(e *events.ApplicationCommandInteractionCreate) {
joke := simpleGetFromAPI("joke", "https://icanhazdadjoke.com/").(string)
@@ -20,5 +29,4 @@ var cmd_dadjoke = Command{
logrus.Error(err)
}
},
AllowDM: true,
}