Skip to content

Commit

Permalink
chore: improve no token error
Browse files Browse the repository at this point in the history
  • Loading branch information
kravetsone committed May 20, 2024
1 parent 43f213b commit f4d321f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class Bot<
const token =
typeof tokenOrOptions === "string"
? tokenOrOptions
: tokenOrOptions.token;
: tokenOrOptions?.token;

if (!token || typeof token !== "string")
throw new Error(`Token is ${typeof token} but it should be a string!`);
Expand Down

0 comments on commit f4d321f

Please sign in to comment.