The Main App module houses the bot events, process events, and initializes
the bot. It also handles new members and greets them.
Methods
# inner createALogger(loggerName, loggerLabelopt, handleRejectionsExceptionsopt, LogToConsoleopt) → {winston.Logger}
Will create a default logger to use.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
loggerName |
String | |||
loggerLabel |
String |
<optional> |
'' | usually a more readable logger name |
handleRejectionsExceptions |
Boolean |
<optional> |
false | will handle rejections and exceptions if true |
LogToConsole |
Boolean |
<optional> |
false | will log all levels to console if true |
winston.Logger
# async inner fixDMIssue(error, member, botGuild)
Will let the member know how to fix their DM issue.
Parameters:
Name | Type | Description |
---|---|---|
error |
Error | the error |
member |
Discord.GuildMember | the member with the error |
botGuild |
BotGuildModel |
Error if the given error is not a DM error
# inner getConfig(args) → {Map}
Returns the config settings depending on the command line args.
Read command line args to know if prod, dev, or test and what server
First arg is one of prod, dev or test
the second is the test server, but the first one must be test
Parameters:
Name | Type | Description |
---|---|---|
args |
Array.<string> |
config settings
Map
# async inner greetNewMember(member, botGuild)
Greets a member!
Parameters:
Name | Type | Description |
---|---|---|
member |
Discord.GuildMember | the member to greet |
botGuild |
BotGuildModel |
Error if the user has server DMs off