Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
trickstarcandina committed Sep 13, 2021
1 parent 451eb8b commit b682536
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 9 deletions.
8 changes: 3 additions & 5 deletions eventMidLunar/countMsg.gotmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{{$note := dbGet .User.ID "countmoon"}}
{{if $note}}
{{dbIncr .User.ID "countmoon" 1}}
{{else}}
{{dbSet .User.ID "countmoon" 1}}
{{$a := len .Message.Content}}
{{if gt $a 6}}
{{$newXP := dbIncr .User.ID "countmoon" 1}}
{{end}}
17 changes: 17 additions & 0 deletions eventMidLunar/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 "moondaily" }}
{{ $daily = .Value }}
{{ end }}

{{if eq (toInt $daily) 0}}
{{ $b := dbIncr .User.ID "moondaily" 1 }}
{{ $s := dbIncr .User.ID "countticket" 2 }}
{{.User.Mention}} điểm danh thành công đã nhận được 2 hộp bánh, bạn đang có {{$s}} hộp, mở hộp bằng lệnh -open.
{{else}}
{{.User.Mention}} đã điểm danh hôm nay. Ngày mai hãy quay lại nhé.
{{end}}
6 changes: 3 additions & 3 deletions eventMidLunar/getTicket.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@

{{end}}

{{.User.Mention}} bạn đã chat {{$msg}} tin nhắn. Bạn có {{ $totalticket }} lượt quay.
{{.User.Mention}} bạn đã chat {{$msg}} tin nhắn. Bạn có {{ $totalticket }} hộp bánh.

{{else}}

{{.User.Mention}} bạn đã chat {{$msg}} tin nhắn. Bạn có {{ $totalticket }} lượt quay.
Bạn đã nhận hết lượt quay từ chat, hãy voice thêm để kiếm thêm lượt nhé.
{{.User.Mention}} bạn đã chat {{$msg}} tin nhắn. Bạn có {{ $totalticket }} hộp bánh.
Bạn đã nhận hết hộp bánh từ chat, hãy voice thêm để kiếm thêm lượt nhé.

{{end}}
27 changes: 26 additions & 1 deletion eventMidLunar/inventory.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,29 @@
{{$min = (toInt $worde)}}
{{end}}

{{.User.Mention}} đang có {{$wordm}} <a:cat_M:819202996747108352> {{$wordo}} <a:cat_O:819203089349345350> {{$wordn}} <a:cat_N:819203075977904188> {{$wordc}} <a:cat_C:819201905741529098> {{$worda}} <a:cat_A:819201634395488288> {{$wordk}} <a:cat_K:819202981416927304> {{$worde}} <a:cat_E:819202860670648340> . Ghép được {{$min}} bánh trung thu. Làm nhiệm vụ để kiếm thêm nhé !
{{ $countcake := 0 }}
{{ with dbGet .User.ID "countcake" }}
{{ $countcake = .Value }}
{{ end }}
{{$a := dbIncr .User.ID "countcake" (sub $min (toInt $countcake))}}

{{ $user := .User }}
{{ $color := 14232643 }}
{{ $avatar := (joinStr "" "https://cdn.discordapp.com/avatars/" (toString .User.ID) "/" .User.Avatar ".png") }}
{{$embed := sdict
"title" (joinStr "" "❯ Kho đồ của " .User.Username "!")
"color" $color
"fields" (cslice
(sdict "name" "<a:cat_M:819202996747108352>" "value" (toString (toInt $wordm)) "inline" true)
(sdict "name" "<a:cat_O:819203089349345350>" "value" (toString (toInt $wordo)) "inline" true)
(sdict "name" "<a:cat_N:819203075977904188>" "value" (toString (toInt $wordn)) "inline" true)
(sdict "name" "<a:cat_C:819201905741529098>" "value" (toString (toInt $wordc)) "inline" true)
(sdict "name" "<a:cat_A:819201634395488288>" "value" (toString (toInt $worda)) "inline" true)
(sdict "name" "<a:cat_K:819202981416927304>" "value" (toString (toInt $wordk)) "inline" true)
(sdict "name" "<a:cat_E:819202860670648340>" "value" (toString (toInt $worde)) "inline" true)
(sdict "name" "🥮" "value" (toString $min) "inline" false)
)
"thumbnail" (sdict "url" $avatar)
}}

{{ sendMessage nil (cembed $embed) }}
24 changes: 24 additions & 0 deletions eventMidLunar/ranking.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{ $page := 1 }}
{{ with reFind `\d+` (joinStr " " .CmdArgs) }} {{ $page = . | toInt }} {{ end }}
{{ $nextTo := mult (sub $page 1) 10 }}
{{ $users := dbTopEntries "countcake" 10 $nextTo }}
{{ if not (len $users) }}
Không có ai ở trang này :(
{{ else }}
{{ $rank := $nextTo }}
{{ $display := "" }}
{{- range $users -}}
{{ $xp := toInt .Value }}
{{ $rank = add $rank 1 }}
{{ $display = printf "%s\n• **%d.** [%s](https://www.youtube.com/watch?v=9kaCAbIXuyg) :: Số lượng (%d 🥮)"
$display $rank .User.String $xp
}}
{{- end -}}
{{ $id := sendMessageRetID nil (cembed
"title" "❯ Bảng xếp hạng"
"thumbnail" (sdict "url" "https://lh3.googleusercontent.com/proxy/tWDSXoLnEbYTVEJSUdaG_9mzKSa1UjE-ydVqyLBGTsM049cHCsHxjhq12JblD-lmff-HNsI0kFojtO7wOUZ5UtP__XZonq7wXWjMwRyRBGBZCS8i4wQsxy7ooLy-ETpRLyYVgBm0ReSFVRwcoI9IbuFi2GzU-nBC14AzhovAfyCKna0jV4aPt7cfmtq1KK15QmbJm7y-ENzd")
"color" 14232643
"description" $display
"footer" (sdict "text" (joinStr "" "Trang " $page)))
}}
{{end}}

0 comments on commit b682536

Please sign in to comment.