Skip to content

Commit

Permalink
refactor: avoid top-level await (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
KnorpelSenf authored Jun 16, 2023
1 parent 449fc55 commit 0b5cb51
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,11 @@ export class Composer<C extends Context> implements MiddlewareObj<C> {
* via `ctx.match`.
*
* > **Did you know?** You can use deep linking
* > (https://core.telegram.org/bots/features#deep-linking) to let users start your
* > bot with a custom payload. As an example, send someone the link
* > https://t.me/name-of-your-bot?start=custom-payload and register a start
* > command handler on your bot with grammY. As soon as the user starts
* > your bot, you will receive `custom-payload` in the `ctx.match`
* > (https://core.telegram.org/bots/features#deep-linking) to let users
* > start your bot with a custom payload. As an example, send someone the
* > link https://t.me/name-of-your-bot?start=custom-payload and register a
* > start command handler on your bot with grammY. As soon as the user
* > starts your bot, you will receive `custom-payload` in the `ctx.match`
* > property!
* > ```ts
* > bot.command('start', ctx => {
Expand Down Expand Up @@ -366,8 +366,8 @@ export class Composer<C extends Context> implements MiddlewareObj<C> {
* // etc
* ```
*
* If you need more freedom matching your commands, check out the
* `command-filter` plugin.
* If you need more freedom matching your commands, check out the `commands`
* plugin.
*
* @param command The command to look for
* @param middleware The middleware to register
Expand Down
2 changes: 1 addition & 1 deletion src/platform.deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const DEBUG = "DEBUG";
if (isDeno) {
d.useColors = () => !Deno.noColor;
const env = { name: "env", variable: DEBUG } as const;
const res = await Deno.permissions.query(env);
const res = Deno.permissions.querySync(env);
let namespace: string | undefined = undefined;
if (res.state === "granted") namespace = Deno.env.get(DEBUG);
if (namespace) d.enable(namespace);
Expand Down

0 comments on commit 0b5cb51

Please sign in to comment.