-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加解析b站视频app卡片功能 增加查询bot内存占用功能 增加自动同意好友请求功能 新增群发消息功能 修复十连抽卡时,sql过慢的问题
- Loading branch information
1 parent
96c564e
commit 5462a53
Showing
21 changed files
with
1,102 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
CommandPrefix: "" | ||
SuperUsers: [""] | ||
WS: "ws://127.0.0.1:6700" | ||
SuperUsers: ["1846865993"] | ||
WS: "ws://192.168.0.104:8080" | ||
AccessToken: "114514" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package arknights | ||
|
||
import ( | ||
"fmt" | ||
zero "github.com/wdvxdr1123/ZeroBot" | ||
"github.com/wdvxdr1123/ZeroBot/message" | ||
"gorm.io/gorm" | ||
"time" | ||
) | ||
|
||
func init() { | ||
zero.OnCommand("签到"). | ||
Handle(func(ctx *zero.Ctx) { | ||
var user User | ||
err := DB.First(&user, "qq = ?", ctx.Event.UserID).Error | ||
if err == gorm.ErrRecordNotFound { | ||
user = User{ | ||
QQ: ctx.Event.UserID, | ||
Chars: "{}", | ||
TenGachaTickets: 0, | ||
LastCheckInTime: time.Unix(0, 0), | ||
} | ||
} | ||
if user.isCanCheckIn() { | ||
user.LastCheckInTime = time.Now() | ||
user.TenGachaTickets = 10 | ||
ctx.SendChain( | ||
message.Text("签到获得10十连券"), | ||
) | ||
err = DB.Save(&user).Error | ||
err := DB.First(&user, "qq = ?", ctx.Event.UserID).Error | ||
fmt.Println(user.TenGachaTickets) | ||
if err != nil { | ||
fmt.Println(err) | ||
return | ||
} | ||
} else { | ||
ctx.SendChain( | ||
message.Text("今日已签过到"), | ||
) | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.