Skip to content

Commit 8386128

Browse files
committed
(clean) remove deprecated commands
1 parent 6cc974a commit 8386128

File tree

2 files changed

+4
-64
lines changed

2 files changed

+4
-64
lines changed

cmd/shibesbot/discord.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ var (
2424
},
2525
},
2626
},
27-
{
28-
Name: "swalls",
29-
Description: "Returns a wallpaper with a Shiba ina !",
30-
},
31-
{
32-
Name: "sgifs",
33-
Description: "Returns a gif with a Shiba ina !"},
3427
{
3528
Name: "shelp",
3629
Description: "Returns helper",
@@ -92,8 +85,6 @@ func (sb *Shibesbot) commandPicker(s *discordgo.Session, i *discordgo.Interactio
9285
switch i.ApplicationCommandData().Name {
9386
case "shibes":
9487
response = sb.getShibes()
95-
case "sgifs":
96-
response = getShibesGifs()
9788
case "shelp":
9889
err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
9990
Type: discordgo.InteractionResponseChannelMessageWithSource,
@@ -104,19 +95,14 @@ func (sb *Shibesbot) commandPicker(s *discordgo.Session, i *discordgo.Interactio
10495
if err != nil {
10596
sb.log.Error("could not answer to user help command: ", err.Error())
10697
}
107-
return
108-
case "swalls":
109-
response = getShibesWallpaper()
11098
}
11199

112-
err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
100+
if err := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
113101
Type: discordgo.InteractionResponseChannelMessageWithSource,
114102
Data: &discordgo.InteractionResponseData{
115103
Content: response,
116104
},
117-
})
118-
119-
if err != nil {
105+
}); err != nil {
120106
sb.log.Error("could not answer to user help command: ", err.Error())
121107
return
122108
}

cmd/shibesbot/dogequests.go

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
package main
22

33
import (
4-
"math/rand"
54
"net/http"
65

7-
"github.com/ivolo/go-giphy"
8-
96
"encoding/json"
107

118
"github.com/bwmarrin/discordgo"
@@ -15,41 +12,14 @@ var (
1512
Shibes ShibesData
1613
)
1714

18-
type WallpaperData struct {
19-
Id int
20-
Width int
21-
Height int
22-
Url_Image string
23-
}
24-
25-
type AlphacodersData struct {
26-
Success bool
27-
Wallpapers []WallpaperData
28-
Total_Match int
29-
}
30-
3115
type ShibesPictures struct {
3216
Shibes []string
3317
Total int
3418
Cursor int
3519
}
3620

37-
type ShibesGifs struct {
38-
Shibes []giphy.Gif
39-
Total int
40-
Cursor int
41-
}
42-
43-
type ShibesWallpapers struct {
44-
Shibes []WallpaperData
45-
Total int
46-
Cursor int
47-
}
48-
4921
type ShibesData struct {
50-
Images ShibesPictures
51-
Gifs ShibesGifs
52-
Wallpapers ShibesWallpapers
22+
Images ShibesPictures
5323
}
5424

5525
func (sb *Shibesbot) getShibes() string {
@@ -85,27 +55,11 @@ func getHelp() *discordgo.MessageEmbed {
8555
{
8656
Name: "Available commands",
8757
Value: "- *shibes* to get a random shibe !\n" +
88-
"- *sgifs* to get a random gif of shiba !\n" +
89-
"- *shelp* to get help\n" +
90-
"- *swalls* to get an amazing shibe wallpaper",
58+
"- *shelp* to get help",
9159
Inline: false,
9260
},
9361
},
9462
Title: "Hello shibes !",
9563
}
9664
return test
9765
}
98-
99-
func getShibesGifs() string {
100-
if Shibes.Gifs.Total <= 0 {
101-
return "no gifs available, sorry. :("
102-
}
103-
return Shibes.Gifs.Shibes[rand.Int()%Shibes.Gifs.Total].URL
104-
}
105-
106-
func getShibesWallpaper() string {
107-
if Shibes.Wallpapers.Total <= 0 {
108-
return "no wallpapers available, sorry. :("
109-
}
110-
return string(Shibes.Wallpapers.Shibes[rand.Int()%Shibes.Wallpapers.Total].Url_Image)
111-
}

0 commit comments

Comments
 (0)