Compare commits
7 Commits
aa7c3791ef
...
e079438254
Author | SHA1 | Date |
---|---|---|
skeletable | e079438254 | |
skeletable | f471ee2734 | |
skeletable | 2d8b850bc6 | |
skeletable | 918a7c0f41 | |
skeletable | 203bc227f3 | |
skeletable | 6ba5e66fcf | |
skeletable | d3dd80cf0f |
84
main.go
84
main.go
|
@ -123,7 +123,7 @@ func getCandyPic() string {
|
|||
return pics[rand.Intn(len(pics))]
|
||||
}
|
||||
|
||||
func candy(s *discordgo.Session, channel string) {
|
||||
func candy(s *discordgo.Session, channel string, droptype string) {
|
||||
candy1 := &discordgo.MessageEmbed{
|
||||
Title: "Candy",
|
||||
Color: 0,
|
||||
|
@ -216,29 +216,50 @@ func candy(s *discordgo.Session, channel string) {
|
|||
}
|
||||
|
||||
drop := candy1
|
||||
|
||||
rand.Seed(time.Now().Unix())
|
||||
switch rand.Intn(40) {
|
||||
case 1, 2:
|
||||
drop = candyCaptain
|
||||
case 3, 4:
|
||||
drop = candyMilky
|
||||
case 5, 6:
|
||||
drop = candyRadmeal
|
||||
case 7:
|
||||
drop = candyMeta
|
||||
case 8, 9:
|
||||
drop = candyXorcon
|
||||
case 10, 11:
|
||||
drop = candyKornflake
|
||||
case 12, 13:
|
||||
drop = candyKiko
|
||||
case 39:
|
||||
drop = candyChaos
|
||||
default:
|
||||
drop = candy1
|
||||
if droptype == "" {
|
||||
rand.Seed(time.Now().Unix())
|
||||
switch rand.Intn(40) {
|
||||
case 1, 2:
|
||||
drop = candyCaptain
|
||||
case 3, 4:
|
||||
drop = candyMilky
|
||||
case 5, 6:
|
||||
drop = candyRadmeal
|
||||
case 7:
|
||||
drop = candyMeta
|
||||
case 8, 9:
|
||||
drop = candyXorcon
|
||||
case 10, 11:
|
||||
drop = candyKornflake
|
||||
case 12, 13:
|
||||
drop = candyKiko
|
||||
case 39:
|
||||
drop = candyChaos
|
||||
default:
|
||||
drop = candy1
|
||||
}
|
||||
} else {
|
||||
switch droptype {
|
||||
case "candyCaptain":
|
||||
drop = candyCaptain
|
||||
case "candyMilky":
|
||||
drop = candyMilky
|
||||
case "candyRadmeal":
|
||||
drop = candyRadmeal
|
||||
case "candyMeta":
|
||||
drop = candyMeta
|
||||
case "candyXorcon":
|
||||
drop = candyXorcon
|
||||
case "candyKornflake":
|
||||
drop = candyKornflake
|
||||
case "candyKiko":
|
||||
drop = candyKiko
|
||||
case "candyChaos":
|
||||
drop = candyChaos
|
||||
default:
|
||||
drop = candy1
|
||||
}
|
||||
}
|
||||
|
||||
ms := &discordgo.MessageSend{
|
||||
Content: "🍬 ***Some candy has appeared! React to this message to claim it.*** 🍬",
|
||||
Embed: drop,
|
||||
|
@ -725,12 +746,12 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||
multiplier = maxcandy / usercandy
|
||||
}
|
||||
}
|
||||
if multiplier > 10 {
|
||||
multiplier = 10
|
||||
}
|
||||
candyvalue *= multiplier
|
||||
candystr = "+" + fmt.Sprint(candyvalue)
|
||||
} else if m.Embeds[0].Footer.Text != "candyChaos" {
|
||||
if usercandy < 0 {
|
||||
candyvalue = int(math.Abs(float64(candyvalue)))
|
||||
}
|
||||
candystr = fmt.Sprint(candyvalue)
|
||||
} else {
|
||||
multiplier = rand.Intn(21) - 10
|
||||
|
@ -765,7 +786,7 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||
|
||||
rand.Seed(time.Now().Unix())
|
||||
if rand.Intn(100) < 4 {
|
||||
candy(s, m.ChannelID)
|
||||
candy(s, m.ChannelID, "")
|
||||
}
|
||||
|
||||
if strings.HasPrefix(m.Content, "pp!") {
|
||||
|
@ -1284,8 +1305,13 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||
s.ChannelMessageSend(m.ChannelID, "Unblocked "+felon)
|
||||
}
|
||||
|
||||
if m.Content == "insert candy" && m.Author.ID == "228911057316347905" {
|
||||
candy(s, m.ChannelID)
|
||||
if strings.HasPrefix(m.Content, "pp!spawncandy") && m.Author.ID == "228911057316347905" {
|
||||
arg := strings.Split(m.Content, " ")
|
||||
if len(arg) < 2 {
|
||||
candy(s, m.ChannelID, "")
|
||||
} else {
|
||||
candy(s, m.ChannelID, arg[1])
|
||||
}
|
||||
}
|
||||
|
||||
if strings.HasPrefix(m.Content, "pp!db") && m.Author.ID == "228911057316347905" {
|
||||
|
|
Loading…
Reference in New Issue