Skip to content

Commit

Permalink
clone file to new folder
Browse files Browse the repository at this point in the history
  • Loading branch information
trickstarcandina committed Dec 12, 2023
1 parent 491e8dc commit 720eeeb
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 0 deletions.
49 changes: 49 additions & 0 deletions eventChristmas2023/claim.gotmpl
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}}
17 changes: 17 additions & 0 deletions eventChristmas2023/daily.gotmpl
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}}
20 changes: 20 additions & 0 deletions eventChristmas2023/giveTicket.gotmpl
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 added eventChristmas2023/key
Empty file.
Empty file added eventChristmas2023/top.gotmpl
Empty file.

0 comments on commit 720eeeb

Please sign in to comment.