mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 06:13:51 +08:00
✏️ 求签设置seed避免重复
This commit is contained in:
parent
63f3b3861e
commit
59c6fe593a
@ -3,6 +3,7 @@ package omikuji
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"time"
|
||||||
|
|
||||||
zero "github.com/wdvxdr1123/ZeroBot"
|
zero "github.com/wdvxdr1123/ZeroBot"
|
||||||
"github.com/wdvxdr1123/ZeroBot/message"
|
"github.com/wdvxdr1123/ZeroBot/message"
|
||||||
@ -13,6 +14,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() { // 插件主体
|
func init() { // 插件主体
|
||||||
|
rand.Seed(time.Now().UnixMicro())
|
||||||
zero.OnFullMatchGroup([]string{"求签", "运势", "占卜"}, zero.OnlyToMe).SetPriority(10).
|
zero.OnFullMatchGroup([]string{"求签", "运势", "占卜"}, zero.OnlyToMe).SetPriority(10).
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
miku := rand.Intn(100) + 1
|
miku := rand.Intn(100) + 1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user