Skip to content
Snippets Groups Projects
Commit f6e91f10 authored by Reviath's avatar Reviath
Browse files

Added kiss command as interaction.

parent 0e55e780
Branches
Tags v1.6.7
No related merge requests found
......@@ -185,4 +185,22 @@ func RunAllInteractions(client *discordgo.Session, BotID string) {
if err != nil {
print(err.Error())
}
kisscommand := interactions.Command{
Name: "kiss",
Description: "Sends kiss gif.",
Options: []interactions.CommandOption{
{
Type: interactions.OptionTypeString,
Name: "User",
Required: true,
Description: "Specify a user to kiss.",
},
},
}
err = interactions.GlobalCommandCreate(client, BotID, kisscommand)
if err != nil {
print(err.Error())
}
}
package interaction_commands
import (
"fmt"
embedutil "git.randomchars.net/Reviath/RemiliaScarlet/EmbedUtil"
multiplexer "git.randomchars.net/Reviath/RemiliaScarlet/Multiplexer"
"git.randomchars.net/Reviath/RemiliaScarlet/interactions"
"git.randomchars.net/Reviath/RemiliaScarlet/sql"
"github.com/bwmarrin/discordgo"
)
func KissCommand(session *discordgo.Session, interaction interactions.Interaction) interactions.InteractionResponse {
if sql.CheckLanguage(interaction.GuildID) == "tr" {
if sql.IsBlocked(interaction.GuildID, "kiss") == "true" {
return multiplexer.CreateResponse("Bu komut bu sunucuda engellenmiş.")
}
u, err := session.User(multiplexer.GetUser(interaction.Data.Options[0].Value.(string)))
if err == nil {
embed := embedutil.NewEmbed().
SetColor(0xff1000).
SetDescription(fmt.Sprintf("<@%s>, <@%s> isimli kişiyi öptü 😘", interaction.Member.User.ID, u.ID)).
SetImage("https://media.tenor.com/images/d68747a5865b12c465e5dff31c65d5c2/tenor.gif").MessageEmbed
return multiplexer.CreateEmbedResponse(embed)
}
return multiplexer.CreateResponse("Bir üye belirtmelisin")
}
if sql.IsBlocked(interaction.GuildID, "kiss") == "true" {
return multiplexer.CreateResponse("This command is blocked on this guild.")
}
u, err := session.User(multiplexer.GetUser(interaction.Data.Options[0].Value.(string)))
if err == nil {
embed := embedutil.NewEmbed().
SetColor(0xff1000).
SetDescription(fmt.Sprintf("<@%s> kisses <@%s>", interaction.Member.User.ID, u.ID)).
SetImage("https://media.tenor.com/images/d68747a5865b12c465e5dff31c65d5c2/tenor.gif").MessageEmbed
return multiplexer.CreateEmbedResponse(embed)
}
return multiplexer.CreateResponse("You need to specify the user.")
}
......@@ -96,5 +96,12 @@ func InteractionHandler(session *discordgo.Session, event *discordgo.Event) {
return
}
}
if interaction.Data.Name == "kiss" {
response := interaction_commands.KissCommand(session, interaction)
err = interaction.Respond(session, response)
if err != nil {
return
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment