Skip to content

Commit

Permalink
wip (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
eatmoreapple authored Nov 6, 2023
1 parent 5f34d35 commit 61a634f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion relations.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package openwechat
import (
"fmt"
"io"
"math/rand"
"time"
)

Expand Down Expand Up @@ -135,7 +136,8 @@ func (f Friends) SendText(text string, delays ...time.Duration) error {
self := f.First().Self()
return self.SendTextToFriends(text, delay, f...)
}
//向所有好友随机时间间隔发送消息。

// BroadcastTextToFriendsByRandomTime 向所有好友随机时间间隔发送消息。
func (f Friends) BroadcastTextToFriendsByRandomTime(msg string) error {
for _, friend := range f {
time.Sleep(time.Duration(rand.Intn(10)) * time.Second) //随机休眠0-10秒
Expand Down

0 comments on commit 61a634f

Please sign in to comment.