import './lib/setup';
import { BucketScope, LogLevel, SapphireClient } from '@sapphire/framework';
import { GatewayIntentBits, Partials } from 'discord.js';
const client = new SapphireClient({
defaultCooldown: {
delay: 10000,
limit: 2,
scope: BucketScope.Channel
},
defaultPrefix: '.',
caseInsensitiveCommands: true,
logger: {
level: LogLevel.Debug
},
shards: 'auto',
intents: [
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.MessageContent
],
partials: [Partials.Channel],
api: {
listenOptions: {
port: 6000,
},
},
loadMessageCommandListeners: true
});
const main = async () => {
try {
client.logger.info('Logging in');
await client.login();
client.logger.info(`logged in as ${client.user?.tag}`);
} catch (error) {
client.logger.fatal(error);
client.destroy();
process.exit(1);
}
};
main();