Skip to content

Commit

Permalink
fix: change the deno kv prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
dcdunkan committed Nov 14, 2024
1 parent b079ef0 commit 1f8f9e4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ Make sure you have installed [Deno](https://deno.land).
### Deno Deploy

The working bot, [@scripturbot](https://telegram.me/scripturbot) is currently
deployed on [Deno Deploy](https://deno.com/deploy). Even though I
have implemented a fine getbible.net API call caching system, it's not being
used since Deno Deploy currently does not provide file system writing access. If
deployed on [Deno Deploy](https://deno.com/deploy). Even though I have
implemented a fine getbible.net API call caching system, it's not being used
since Deno Deploy currently does not provide file system writing access. If
you're deploying to Heroku or some other, you should be able to enable caching
by providing a `USE_CACHE=1` in [environment variables](#environment-variables).

Expand All @@ -100,11 +100,11 @@ to handle updates.

### Environment Variables

| Variable | Required? | Description |
| ----------- | --------- | -------------------------------------------------------------------------------- |
| `DEBUG` | No. | If not set, the bot would run in the webhook mode. Set to enable long polling. |
| `BOT_TOKEN` | **Yes.** | The API token of the Bot. Chat with https://t.me/BotFather to get one. |
| `USE_CACHE` | No. | Set the value to 1 if you want caching to work. |
| Variable | Required? | Description |
| ----------- | --------- | ------------------------------------------------------------------------------ |
| `DEBUG` | No. | If not set, the bot would run in the webhook mode. Set to enable long polling. |
| `BOT_TOKEN` | **Yes.** | The API token of the Bot. Chat with https://t.me/BotFather to get one. |
| `USE_CACHE` | No. | Set the value to 1 if you want caching to work. |

## License

Expand Down
8 changes: 7 additions & 1 deletion deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export type {
} from "https://deno.land/x/[email protected]/types.ts";
export {
DenoKVAdapter,
} from "https://deno.land/x/[email protected]/denokv/src/mod.ts";
} from "https://raw.githubusercontent.com/grammyjs/storages/5eda80d5f0dc4232c1affdda6aada6cc0ca3160d/packages/denokv/src/mod.ts";
2 changes: 1 addition & 1 deletion src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PRIVATE_CHAT_COMMANDS } from "./helpers/constants.ts";

const BOT_TOKEN = Deno.env.get("BOT_TOKEN");
if (BOT_TOKEN == null) {
throw new Error("Set BOT_TOKEN environment variable.")
throw new Error("Set BOT_TOKEN environment variable.");
}

export const bot = new Bot<Context>(BOT_TOKEN);
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ export function initial(): SessionData {
}

export const kv = await Deno.openKv();
export const storage = new DenoKVAdapter(kv);
export const storage = new DenoKVAdapter(kv, ["users"]);

0 comments on commit 1f8f9e4

Please sign in to comment.