Skip to content

Commit 4d48b9a

Browse files
committed
chore(playground): usage of useRuntimeEnv
1 parent d2b70ea commit 4d48b9a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

playground/harmonix.config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
import { defineHarmonixConfig } from '../src'
22

3-
export default defineHarmonixConfig({
4-
ownerIds: ['556083802628161546']
5-
})
3+
export default defineHarmonixConfig({})
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { definePrecondition, useRuntimeEnv } from '../../src'
2+
3+
export default definePrecondition((interaction) => {
4+
const env = useRuntimeEnv()
5+
const authorId = interaction.member?.user.id
6+
7+
if (authorId && authorId !== env.ownerId) {
8+
interaction?.reply('You are not the owner of this bot!')
9+
return false
10+
}
11+
return true
12+
})

0 commit comments

Comments
 (0)