We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2990716 commit 17aa950Copy full SHA for 17aa950
playground/discord/commands/counter.ts
@@ -0,0 +1,17 @@
1
+import { computed, ref } from 'vue'
2
+
3
+/**
4
+ * @name counter
5
+ * @description A simple counter command that counts button presses
6
+ */
7
+export default function counter() {
8
+ const count = ref(0)
9
+ const message = computed(() => `Count: ${count.value}`)
10
11
+ return reply.button(
12
+ '+1',
13
+ () => void (count.value += 1),
14
+ // hide the button when count reaches 5
15
+ { hide: computed(() => count.value >= 5) },
16
+ ).send(message)
17
+}
0 commit comments