-
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.
- Loading branch information
1 parent
491e8dc
commit 720eeeb
Showing
5 changed files
with
86 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{{ $msg := 0 }} | ||
{{ with dbGet .User.ID "countevent" }} | ||
{{ $msg = .Value }} | ||
{{ end }} | ||
|
||
{{ $totalticket := 0 }} | ||
{{ with dbGet .User.ID "countticket" }} | ||
{{ $totalticket = .Value }} | ||
{{ end }} | ||
|
||
{{ $check := 0 }} | ||
{{ with dbGet .User.ID "checkfull" }} | ||
{{ $check = .Value }} | ||
{{ end }} | ||
|
||
{{/* 6/12/25/50 */}} | ||
|
||
{{if lt (toInt $check) 4}} | ||
|
||
{{if and (gt (toInt $msg) 6) (lt (toInt $msg) 11) (lt (toInt $check) 1)}} | ||
{{ $totalticket = add $totalticket 1}} | ||
{{$a := dbIncr .User.ID "checkfull" 1}} | ||
{{$b := dbIncr .User.ID "countticket" 1}} | ||
|
||
{{else if and (gt (toInt $msg) 12) (lt (toInt $msg) 24) (lt (toInt $check) 2)}} | ||
{{ $totalticket = add $totalticket (sub 2 $check)}} | ||
{{$a := dbIncr .User.ID "checkfull" (sub 2 $check)}} | ||
{{$b := dbIncr .User.ID "countticket" (sub 2 $check)}} | ||
|
||
{{else if and (gt (toInt $msg) 25) (lt (toInt $msg) 49) (lt (toInt $check) 3)}} | ||
{{ $totalticket = add $totalticket (sub 3 $check)}} | ||
{{$a := dbIncr .User.ID "checkfull" (sub 3 $check)}} | ||
{{$b := dbIncr .User.ID "countticket" (sub 3 $check)}} | ||
|
||
{{else if and (gt (toInt $msg) 50) (lt (toInt $check) 4)}} | ||
{{ $totalticket = add $totalticket (sub 4 $check)}} | ||
{{$a := dbIncr .User.ID "checkfull" (sub 4 $check)}} | ||
{{$b := dbIncr .User.ID "countticket" (sub 4 $check)}} | ||
|
||
{{end}} | ||
|
||
{{.User.Mention}} bạn đã chat {{$msg}} tin nhắn. Bạn có {{ $totalticket }} lượt. | ||
|
||
{{else}} | ||
|
||
{{.User.Mention}} bạn đã chat {{$msg}} tin nhắn. Bạn có {{ $totalticket }} lượt. | ||
Bạn đã nhận hết lượt từ chat, hãy voice thêm để kiếm thêm lượt nhé. | ||
|
||
{{end}} |
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,17 @@ | ||
{{ $totalticket := 0 }} | ||
{{ with dbGet .User.ID "countticket" }} | ||
{{ $totalticket = .Value }} | ||
{{ end }} | ||
|
||
{{ $daily := 0 }} | ||
{{ with dbGet .User.ID "eventdaily" }} | ||
{{ $daily = .Value }} | ||
{{ end }} | ||
|
||
{{if eq (toInt $daily) 0}} | ||
{{ $b := dbIncr .User.ID "eventdaily" 1 }} | ||
{{ $s := dbIncr .User.ID "countticket" 3 }} | ||
{{.User.Mention}} Chúc mừng bạn nhận 3 lượt mở ngày hôm nay, bạn đang có {{$s}} lượt, mở bằng lệnh -open. | ||
{{else}} | ||
{{.User.Mention}} đã điểm danh hôm nay. Sau 19h quay lại nhé. | ||
{{end}} |
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,20 @@ | ||
{{ $user := 0 }} | ||
{{$channel := 892974225147699280}} | ||
{{ $timezone := "Asia/Ho_Chi_Minh" }} | ||
{{ $now := currentTime.In (newDate 0 0 0 0 0 0 $timezone).Location }} | ||
{{ $time := $now.Format "3:04:05 PM" }} | ||
{{ with .CmdArgs }} {{ $user = index . 0 | userArg }} {{ end }} | ||
|
||
{{ $soluong := (toInt $.nil) }} | ||
{{ $valid := false }} | ||
{{ with reFind `\A\d+\z` (index .CmdArgs 1) }} {{ $valid = true }} {{ $soluong = toInt . }} {{ end }} | ||
{{ if and $valid $user }} | ||
{{ $s := dbIncr $user.ID "countticket" $soluong }} | ||
{{ printf "Chúc mừng **%s** nhận đc %d lượt, đang có %d lượt!" $user.String $soluong (toInt $s) }} | ||
{{end}} | ||
{{$msgEmbed := cembed | ||
"title" (joinStr "" $time) | ||
"description" (joinStr "" .User.Mention " send to " $user.Mention " value " $soluong) | ||
"color" 16763904 | ||
}} | ||
{{sendMessage $channel $msgEmbed}} |
Empty file.
Empty file.