From d2f351f00c3b017f1631f53a1c28d73dcf1bc1b6 Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Fri, 10 Dec 2021 10:59:40 +0700 Subject: [PATCH] Update README minimal example (based on discordeno cache plugin README) --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 96035b4b1..8addba28f 100644 --- a/README.md +++ b/README.md @@ -79,21 +79,21 @@ Here is a minimal example to get started with: import { createBot, startBot } from "https://deno.land/x/discordeno/mod.ts"; import { enableCachePlugin, enableCacheSweepers } from "https://deno.land/x/discordeno_cache_plugin@0.0.9/mod.ts"; -const bot = enableCachePlugin( - createBot({ - token: Deno.env.get("DISCORD_TOKEN"), - intents: ["Guilds", "GuildMessages"], - botId: Deno.env.get("BOT_ID"), - events: { - ready() { - console.log("Successfully connected to gateway"); - }, - messageCreate(bot, message) { - // Process the message with your command handler here - }, +const baseBot = createBot({ + token: Deno.env.get("DISCORD_TOKEN"), + intents: ["Guilds", "GuildMessages"], + botId: Deno.env.get("BOT_ID"), + events: { + ready() { + console.log("Successfully connected to gateway"); }, - }) -); + messageCreate(bot, message) { + // Process the message with your command handler here + }, + }, +}); + +const bot = enableCachePlugin(baseBot); enableCacheSweepers(bot);