Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createBot() {
fs.mkdirSync(path.join(__dirname, '..', 'data'), { recursive: true });
const commandsDirectoryPath = path.join(__dirname, 'discord_commands');
const messageProcessorsDirectoryPath = path.join(__dirname, 'discord_message_processors');
const settingsFilePath = path.join(__dirname, 'bot_settings.js');
const persistenceDirectoryPath = path.join(__dirname, '..', 'data', 'monochrome-persistence');
const storage = new Monochrome.Plugins.FPersist(persistenceDirectoryPath);
const options = {
prefixes: ['k!'],
commandsDirectoryPath,
messageProcessorsDirectoryPath,
logger: createLogger(),
settingsFilePath,
storage,
useANSIColorsInLogFiles: true,
serverAdminRoleName: 'kotoba',
genericErrorMessage: 'Sorry, there was an error with that command. It has been logged and will be addressed.',
missingPermissionsErrorMessage: 'I do not have permission to reply to that command in this channel. A server admin can give me the permissions I need in the channel settings. I need permission to **embed links**, **attach files**, and **add reactions**. If you do not want this command to be used in this channel, consider using **settings** to disable it.',
genericDMReply: 'Say **help** to see my commands!',
genericMentionReply: 'Hi <@user>, say **help** to see my commands!',
inviteLinkDmReply: 'You can invite me to your server with this link! https://discordapp.com/oauth2/authorize?client_id=251239170058616833&scope=bot&permissions=51264',
statusRotation: [