Skip to content
Permalink
Browse files

Fix config parsing

Fix config options that always show as true. Remove redundant options.
  • Loading branch information
felixonmars authored and Tjzabel committed Nov 16, 2019
1 parent 3748918 commit 9fca64ed1908b3d5dd6b6dabfc1349901a40aef3
Showing with 11 additions and 12 deletions.
  1. +11 −12 config.js
@@ -7,33 +7,32 @@ let settings = {
server: process.env.IRC_SERVER || "irc.freenode.net",
serverPassword: process.env.IRC_SERVER_PASSWORD || "",
port: process.env.IRC_PORT || 6667,
tlsAllowSelfSigned: process.env.IRC_CERT_ALLOW_SELFSIGNED === "true" || false,
tlsAllowCertExpired: process.env.IRC_CERT_ALLOW_EXPIRED === "true" || false,
tlsAllowSelfSigned: process.env.IRC_CERT_ALLOW_SELFSIGNED === "true",
tlsAllowCertExpired: process.env.IRC_CERT_ALLOW_EXPIRED === "true",
channel: process.env.IRC_CHANNEL || "",
channelKey: process.env.IRC_CHANNEL_KEY || "",
botName: process.env.IRC_BOT_NAME || "teleirc",
sendStickerEmoji: process.env.IRC_SEND_STICKER_EMOJI === "true" || true,
sendDocument: process.env.IRC_SEND_DOCUMENT === "true" || false,
sendStickerEmoji: process.env.IRC_SEND_STICKER_EMOJI !== "false",
sendDocument: process.env.IRC_SEND_DOCUMENT === "true",
prefix: process.env.IRC_PREFIX || "<",
suffix: process.env.IRC_SUFFIX || ">",
showJoinMessage: process.env.IRC_SHOW_JOIN_MESSAGE === "true" || true,
showLeaveMessage: process.env.IRC_SHOW_LEAVE_MESSAGE === "true" || true,
showJoinMessage: process.env.IRC_SHOW_JOIN_MESSAGE !== "false",
showLeaveMessage: process.env.IRC_SHOW_LEAVE_MESSAGE !== "false",
nickservPassword: process.env.IRC_NICKSERV_PASS || "",
nickservService: process.env.IRC_NICKSERV_SERVICE || "",
editedPrefix: process.env.IRC_EDITED_PREFIX || "[EDIT]",
maxMessageLength: Number(process.env.IRC_MAX_MESSAGE_LENGTH) || 400,
},
tg: {
chatId: process.env.TELEGRAM_CHAT_ID || "-000000000",
showJoinMessage: process.env.SHOW_JOIN_MESSAGE === "true" || false,
showActionMessage: process.env.SHOW_ACTION_MESSAGE === "true" || true,
showLeaveMessage: process.env.SHOW_LEAVE_MESSAGE === "true" || false,
showKickMessage: process.env.SHOW_KICK_MESSAGE === "true" || false,
showJoinMessage: process.env.SHOW_JOIN_MESSAGE === "true",
showActionMessage: process.env.SHOW_ACTION_MESSAGE !== "false",
showLeaveMessage: process.env.SHOW_LEAVE_MESSAGE === "true",
showKickMessage: process.env.SHOW_KICK_MESSAGE === "true",
maxMessagesPerMinute: Number(process.env.MAX_MESSAGES_PER_MINUTE) || 20,
},
imgur: {
useImgurForImageLinks: process.env.USE_IMGUR_FOR_IMAGES === "true" ||
false,
useImgurForImageLinks: process.env.USE_IMGUR_FOR_IMAGES === "true",
imgurClientId: process.env.IMGUR_CLIENT_ID || "12345",
}
}

0 comments on commit 9fca64e

Please sign in to comment.
You can’t perform that action at this time.