Commit a7a376d 1 parent 56a30f6 commit a7a376d Copy full SHA for a7a376d
File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ PLAY_HT_SECRET_KEY=
26
26
PLAY_HT_USER_ID=
27
27
PLAY_HT_VOICE= # check docs for available voices https://playht.github.io/api-docs-generator/#utra-realistic-voices
28
28
OPENAI_MODEL=gpt-3.5-turbo # only if you don't have access to GPT-4
29
+ #SERVE_THIS_USER_ONLY=99999999 # uncomment this if you want to only serve this user id. The ID will be printed on stdout.
29
30
```
30
31
31
32
4 . ` npm install `
Original file line number Diff line number Diff line change @@ -28,6 +28,15 @@ bot.help((ctx) => {
28
28
} ) ;
29
29
30
30
bot . on ( "voice" , async ( ctx ) => {
31
+
32
+ if ( process . env . SERVE_THIS_USER_ONLY && parseInt ( process . env . SERVE_THIS_USER_ONLY ) !== ctx . message . chat . id ) {
33
+ console . log ( `User ${ ctx . message . chat . id . toString ( ) } is not allowed to be served.` ) ;
34
+ await ctx . reply (
35
+ "Sorry, you're not allowed to be served by me."
36
+ ) ;
37
+ return ;
38
+ }
39
+
31
40
const voice = ctx . message . voice ;
32
41
await ctx . sendChatAction ( "typing" ) ;
33
42
You can’t perform that action at this time.
0 commit comments