File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " discraft" ,
3- "version" : " 1.6.2-beta.7 " ,
3+ "version" : " 1.6.2-beta.8 " ,
44 "description" : " Ultimate Discord bot framework" ,
55 "type" : " module" ,
66 "packageManager" : " bun@1.1.42" ,
Original file line number Diff line number Diff line change 11import { execSync } from "child_process" ;
22
3+ function getEnvVar ( key : string ) : string | undefined {
4+ // Create a completely isolated dynamic lookup.
5+ // This is necessary to avoid static replacement of process.env.SOME_VARIABLE
6+ if ( Object . prototype . hasOwnProperty . call ( process . env , key ) ) {
7+ return process . env [ key ] ;
8+ }
9+ return undefined ;
10+ }
11+
312async function detectPackageManager ( ) : Promise < string | undefined > {
4- // Access process.env dynamically to avoid static replacement during build
5- const userAgent = Object . prototype . hasOwnProperty . call (
6- process . env ,
7- "npm_config_user_agent" ,
8- )
9- ? process . env . npm_config_user_agent
10- : undefined ;
13+ const userAgent = getEnvVar ( "npm_config_user_agent" ) ;
1114
1215 if ( userAgent ) {
1316 if ( userAgent . startsWith ( "bun" ) ) {
Original file line number Diff line number Diff line change @@ -28,7 +28,9 @@ registerEvents(client)
2828 }
2929 } ) ;
3030 client . login ( process . env . DISCORD_TOKEN ) . catch ( ( err ) => {
31- logger . error ( "Client login failed." ) ;
31+ logger . error (
32+ "Client login failed, make sure your token is set correctly." ,
33+ ) ;
3234 logger . verbose ( err ) ;
3335 } ) ;
3436 } ) ;
You can’t perform that action at this time.
0 commit comments