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

@@ -42,6 +42,15 @@ var cmd_userinfo Command = Command{
Definition: discord.SlashCommandCreate{
Name: "info",
Description: "Gives you information about a user or this bot.",
Contexts: []discord.InteractionContextType{
discord.InteractionContextTypeGuild,
discord.InteractionContextTypePrivateChannel,
discord.InteractionContextTypeBotDM,
},
IntegrationTypes: []discord.ApplicationIntegrationType{
discord.ApplicationIntegrationTypeGuildInstall,
discord.ApplicationIntegrationTypeUserInstall,
},
Options: []discord.ApplicationCommandOption{
&discord.ApplicationCommandOptionSubCommand{
Name: "user",
@@ -92,7 +101,7 @@ var cmd_userinfo Command = Command{
embedBuilder.AddField("Discriminator", user.Discriminator, false)
}
if user.AccentColor != nil {
embedBuilder.AddField("Accent color", strconv.Itoa(*user.AccentColor), true)
embedBuilder.AddField("Accent color", "#"+strconv.FormatInt(int64(*user.AccentColor), 16), true)
}
if user.AvatarDecorationURL() != nil {
value := fmt.Sprintf("[PNG (animated)](%s)\n[PNG](%s)", *user.AvatarDecorationURL(), *user.AvatarDecorationURL()+"?passthrough=false")
@@ -119,7 +128,6 @@ var cmd_userinfo Command = Command{
}
},
AllowDM: true,
}
func checkDefaultPb(user discord.User) string {