-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (25 loc) · 1.51 KB
/
index.js
File metadata and controls
30 lines (25 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const config = require("./config.js");
const { ForgeClient } = require("@tryforge/forgescript")
const { ForgeDB } = require("@tryforge/forge.db")
require('@dotenvx/dotenvx').config({path: ['.env.local', '.env'], ignore: ['MISSING_ENV_FILE'], strict: false, quiet: true, opsOff: true}) // Enable env support in local hosting
// Client initialization
const client = new ForgeClient({
intents: ["Guilds", "GuildMessages", "GuildMembers", "MessageContent", "GuildPresences", "GuildModeration"], // Intents
prefixes: ["$getGuildVar[prefix]"], // Custom prefix system
events: ["clientReady", "error", "interactionCreate", "messageCreate", "messageDelete", "messageUpdate", "guildMemberAdd", "guildMemberRemove", "guildBanAdd", "guildBanRemove", "guildCreate"], // Setup ForgeScript events
extensions: [ // Load extensions
new ForgeDB({ // Setup database with better-sqlite3
type: "better-sqlite3"
})
],
mobile: config.MobileStatus, // Mobile status
disableConsoleErrors: config.disableConsoleErrors, // Console errors option
prefixCaseInsensitive: config.prefixCaseInsensitive, // Whether or not prefix should be case sensitive
respondOnEdit: config.respondOnEdit // Whether or not to respond to message edits triggering commands
})
// Handlers
client.commands.load("./commands")
ForgeDB.variables(require("./handlers/variables.js"));
client.functions.add(...require("./handlers/functions.js"));
// Your bot token
client.login(process.env.BotToken || config.BotToken);