mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-21 02:40:08 +00:00
Update README minimal example (based on discordeno cache plugin README)
This commit is contained in:
28
README.md
28
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user