diff --git a/cmd/shibesbot/discord.go b/cmd/shibesbot/discord.go index 17223de..0c41cb4 100644 --- a/cmd/shibesbot/discord.go +++ b/cmd/shibesbot/discord.go @@ -24,13 +24,6 @@ var ( }, }, }, - { - Name: "swalls", - Description: "Returns a wallpaper with a Shiba ina !", - }, - { - Name: "sgifs", - Description: "Returns a gif with a Shiba ina !"}, { Name: "shelp", Description: "Returns helper", @@ -92,8 +85,6 @@ func (sb *Shibesbot) commandPicker(s *discordgo.Session, i *discordgo.Interactio switch i.ApplicationCommandData().Name { case "shibes": response = sb.getShibes() - case "sgifs": - response = getShibesGifs() case "shelp": err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, @@ -104,19 +95,14 @@ func (sb *Shibesbot) commandPicker(s *discordgo.Session, i *discordgo.Interactio if err != nil { sb.log.Error("could not answer to user help command: ", err.Error()) } - return - case "swalls": - response = getShibesWallpaper() } - err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ + if err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{ Content: response, }, - }) - - if err != nil { + }); err != nil { sb.log.Error("could not answer to user help command: ", err.Error()) return } diff --git a/cmd/shibesbot/dogequests.go b/cmd/shibesbot/dogequests.go index e85299b..e20f0ba 100644 --- a/cmd/shibesbot/dogequests.go +++ b/cmd/shibesbot/dogequests.go @@ -1,11 +1,8 @@ package main import ( - "math/rand" "net/http" - "github.com/ivolo/go-giphy" - "encoding/json" "github.com/bwmarrin/discordgo" @@ -15,41 +12,14 @@ var ( Shibes ShibesData ) -type WallpaperData struct { - Id int - Width int - Height int - Url_Image string -} - -type AlphacodersData struct { - Success bool - Wallpapers []WallpaperData - Total_Match int -} - type ShibesPictures struct { Shibes []string Total int Cursor int } -type ShibesGifs struct { - Shibes []giphy.Gif - Total int - Cursor int -} - -type ShibesWallpapers struct { - Shibes []WallpaperData - Total int - Cursor int -} - type ShibesData struct { - Images ShibesPictures - Gifs ShibesGifs - Wallpapers ShibesWallpapers + Images ShibesPictures } func (sb *Shibesbot) getShibes() string { @@ -85,9 +55,7 @@ func getHelp() *discordgo.MessageEmbed { { Name: "Available commands", Value: "- *shibes* to get a random shibe !\n" + - "- *sgifs* to get a random gif of shiba !\n" + - "- *shelp* to get help\n" + - "- *swalls* to get an amazing shibe wallpaper", + "- *shelp* to get help", Inline: false, }, }, @@ -95,17 +63,3 @@ func getHelp() *discordgo.MessageEmbed { } return test } - -func getShibesGifs() string { - if Shibes.Gifs.Total <= 0 { - return "no gifs available, sorry. :(" - } - return Shibes.Gifs.Shibes[rand.Int()%Shibes.Gifs.Total].URL -} - -func getShibesWallpaper() string { - if Shibes.Wallpapers.Total <= 0 { - return "no wallpapers available, sorry. :(" - } - return string(Shibes.Wallpapers.Shibes[rand.Int()%Shibes.Wallpapers.Total].Url_Image) -}