- A wrapper for interfacing with the Discord API.
- Because of its scalability.
You need Node.js 18
or newer to use this package.
If you don't want to use NPM, replace npm install
with your package manager of choice. If that is not the case, you can proceed with this command.
npm install @potoland/framework
const Redis = require('ioredis');
const { DefaultRestAdapter } = require('@biscuitland/rest');
const { Intents } = require('@biscuitland/api-types');
const { Potocuit } = require('@potoland/framework');
const { RedisAdapter } = require('@potoland/cache');
const TOKEN = 'YOUR-BOT-TOKEN';
// This should be inside of an async function cuz marcrock sucks.
(async () => {
const restAdapter = new DefaultRestAdapter({
token: TOKEN
});
const gateway = await restAdapter.get('/gateway/bot');
const bot = new Potocuit({
token: TOKEN,
intents: Intents.GuildMembers
| Intents.Guilds
| Intents.GuildMessages,
shardManagerOptions: {
gateway
},
restAdapter,
cache: {
adapter: new RedisAdapter({
options: { namespace: 'bot' },
client: new Redis()
}),
disabledEvents: [] // You can pass 'ALL' instead of [] if you want to disable all events.
}
});
bot.events.ready = ([id, shards]) => {
console.log(`[${id}] handling ${shards} shards`);
};
await bot.start();
})();