32 Commits

Author SHA1 Message Date
jcreek fa1fada289 fix(*): Add log and try catch loop to prevent getting a user from a mention throwing uncleanly 2021-02-28 09:54:16 +00:00
jcreek eea9841481 feat(*): Clean up whitespace 2021-02-28 09:52:57 +00:00
jcreek 5f875bc91d feat(*): Replace some key messages with embed messages 2021-02-14 19:13:31 +00:00
jcreek dadc08d94c feat(*): Add helpers file with sendEmbedMessage function 2021-02-14 19:13:31 +00:00
jcreek 73906e1957 fix(*): Clear pokemon name and captain name when using the clear queue command 2021-02-14 19:13:31 +00:00
jcreek 84a8f2c22c fix(*): Clear pokemon name and captain ign when filling a queue 2021-02-14 19:13:31 +00:00
jcreek c6333e7d06 feat(*): Disable the automatic channel deletion 2021-02-14 19:13:31 +00:00
jcreek 36366499ed feat(*): Add manual update instructions to readme 2021-02-14 19:13:31 +00:00
jcreek 95e9003ce7 feat(*): Add future feature suggestions section to readme 2021-02-14 19:13:31 +00:00
jcreek 02dc03e5ef fix(*): Enable users with spaces in their username to delete their adventure channels
Why on earth does Discord even allow people to have spaces in their usernames?
2021-02-14 19:13:31 +00:00
jcreek d901ee4672 fix(*): Hand edge cases for the start command 2021-02-14 19:13:31 +00:00
jcreek 6865d021a3 fix(*): Use prefix rather than command text for help and adminhelp commands 2021-02-14 19:13:31 +00:00
jcreek c8dbcd9120 fix(*): Missed empty queue check for when a player leaves a queue they were the only one in 2021-02-14 19:13:31 +00:00
jcreek df6211d5e4 feat(*): Finish implementing start command 2021-02-14 19:13:31 +00:00
jcreek 17a8f98ca3 fix(*): Fix further missed lowercasing of channel names by Discord for text channels 2021-02-14 19:13:31 +00:00
Josh Creek 8d7df9d4ec feat(*): Remove potential feature from readme as it has been implemented 2021-02-14 19:13:31 +00:00
Josh Creek 2e5c468c8f feat(*): Add start command for voting to start the adventure before the queue is full 2021-02-14 19:13:31 +00:00
Josh Creek 3d51cc1551 feat(*): Update help commands to use the correct command symbol from the config file rather than hard-coding one 2021-02-14 19:13:31 +00:00
jcreek be885bc286 fix(*): Fix bug where text channel names are automatically lowercased by Discord so couldn't be deleted if the username had capital letters 2021-02-14 19:13:31 +00:00
jcreek f127e09858 fix(*): Fix broken channel deletion and add more helpful logs 2021-02-14 19:13:31 +00:00
jcreek 3191be31e1 feat(*): Add a dev token for debugging and testing in the dev discord 2021-02-14 19:13:31 +00:00
jcreek c48edec643 feat(*): Enable console logging even in production so Jord can see logs easily 2021-02-14 19:13:31 +00:00
jcreek c642d95335 feat(*): Improve logging and error handling 2021-02-14 19:13:31 +00:00
jcreek e08495bfc2 feat(*): Remove unused getCurrentDateAndTime function 2021-02-14 19:13:30 +00:00
jcreek 087fecf93a fix(*): Further fixes to elasticsearch logging to get the stacktrace coming through correctly 2021-02-14 19:13:30 +00:00
jcreek c3fcc15f06 fix(*): Make the elasticsearch logging render out log data correctly for filtering in kibana 2021-02-14 19:13:29 +00:00
jcreek 939a99b62d feat(*): Implement winston-elasticsearch for logging to Elasticsearch 2021-02-14 19:12:59 +00:00
jcreek 3aa3f7ac52 refactor(*): Move maxqueuesize to alphabetical order 2021-02-14 19:12:11 +00:00
jcreek 9459e2714c feat(*): Increase default channel delete time to 30 minutes 2021-02-14 19:11:53 +00:00
jcreek 6a3cec4a0e feat(*): Add config option to toggle auto deleting commands 2021-02-14 19:11:53 +00:00
jcreek be7ba9e28d feat(*): Add channel delete time to config file 2021-02-14 19:11:53 +00:00
jcreek c48c5f32a9 feat(*): Add config file content 2021-02-14 19:11:04 +00:00
2 changed files with 33 additions and 29 deletions
+3 -3
View File
@@ -3,10 +3,10 @@
"deletecommandstoggle": false, "deletecommandstoggle": false,
"maxqueuesize": 4, "maxqueuesize": 4,
"elasticsearch" : { "elasticsearch" : {
"elasticsearch_address" : "http://jcreek.ddns.net:9200", "elasticsearch_address" : "http://YOUR-ELASTICSEARCH-ADDRESS-GOES-HERE:9200",
"elasticsearch_index_pattern" : "[logs-denbot-]YYYY.MM.DD" "elasticsearch_index_pattern" : "[logs-denbot-]YYYY.MM.DD"
}, },
"prefix": "!", "prefix": "!",
"token-dev": "Nzc4MDI2MTE1NDkwOTA2MTYz.X7L_SA.bNzC1kQUpBSwEsjp_cDGwR62Soo", "token-dev": "YOUR-DEV-TOKEN-GOES-HERE",
"token": "NzcwMDQyMDEzMjY5NDkxNzUy.X5Xzgg.kcr_51g95iUvEcYCfbQvG1Sx8ao" "token": "YOUR-TOKEN-GOES-HERE"
} }
+9 -5
View File
@@ -260,7 +260,7 @@ client.on('message', function (message) {
logger.info(`${message.author.username} used command q in ${message.channel.name}`); logger.info(`${message.author.username} used command q in ${message.channel.name}`);
logger.info( `${message.author.username} joined the queue.`); logger.info(`${message.author.username} joined the queue.`);
sendEmbedMessage(logger, message, Discord, 'Queue in progress', `${message.author.username} joined the queue.`); sendEmbedMessage(logger, message, Discord, 'Queue in progress', `${message.author.username} joined the queue.`);
playerQueue.push(message.author); playerQueue.push(message.author);
@@ -400,17 +400,17 @@ client.on('message', function (message) {
// Remove a tagged user from the queue // Remove a tagged user from the queue
if (command === 'ru' && args[0]) { if (command === 'ru' && args[0]) {
const user = getUserFromMention(args[0]);
// Delete the message with the bot command // Delete the message with the bot command
if (config.deletecommandstoggle) { if (config.deletecommandstoggle) {
message.delete(); message.delete();
} }
logger.info(`${message.author.username} used command ru in ${message.channel.name}`); logger.info(`${message.author.username} used command ru ${user} in ${message.channel.name}`);
try {
const user = getUserFromMention(args[0]);
if ((playerQueue.includes(user))) { if ((playerQueue.includes(user))) {
// Search for the user // Search for the user
for(var i = 0; i < playerQueue.length; i++){ for(var i = 0; i < playerQueue.length; i++){
if ((playerQueue[i].username === user.username)){ if ((playerQueue[i].username === user.username)){
@@ -435,6 +435,10 @@ client.on('message', function (message) {
message.channel.send(`${user.username} is not in the queue.`); message.channel.send(`${user.username} is not in the queue.`);
logger.info( `${message.author.username} attempted to remove ${user.username} from queue but they weren't in it.`); logger.info( `${message.author.username} attempted to remove ${user.username} from queue but they weren't in it.`);
} }
} catch (error) {
logger.error(`Tried to remove user ${args[0]} from queue but got an error: ${error}`);
message.channel.send(`Failed to remove ${args[0]} from the queue.`);
}
} }
if (command === 'dc') { if (command === 'dc') {