Skip to content

Commit

Permalink
Updated mongodb
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyWhoCode committed Aug 18, 2021
1 parent 5c2ec00 commit 0d88588
Show file tree
Hide file tree
Showing 1,737 changed files with 157,770 additions and 77,251 deletions.
6 changes: 3 additions & 3 deletions Commands/approve.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const {dbClient} = require("../mongodb.js")
const globalFunctions = require("../globalfunctions.js")
const {noAlias, cancelAlias} = require("../constants.js")
const post = require("../post.js")
// const post = require("../post.js")
const capitalizeString = str => {
return str[0].toUpperCase() + str.substring(1)
}
Expand Down Expand Up @@ -68,7 +68,7 @@ module.exports = {
})

guidesDB.updateOne({"categoryTitle": { $regex: new RegExp(categoryTitle, "i") }}, {$set: {"embedMessage": embedMessage, "categoryTitle": categoryMsg[0].categoryTitle, "messageID": messageID, "category": categoryMsg[0].category}})
post.post(client, message, "", "Edit", embedMessage)
// post.post(client, message, "", "Edit", embedMessage)
//post function

let logChannel = message.guild.channels.cache.find(ch => ch.name === "guide-log")
Expand Down Expand Up @@ -168,7 +168,7 @@ module.exports = {
})

guidesDB.updateOne({"categoryTitle": { $regex: new RegExp(categoryTitle, "i") }}, {$set: {"embedMessage": embedMessage, "categoryTitle": categoryMsg[0].categoryTitle, "messageID": categoryMsg[0].messageID, "category": categoryMsg[0].category}})
post.post(client, message, "", "Edit", embedMessage)
// post.post(client, message, "", "Edit", embedMessage)
//post function
let logChannel = message.guild.channels.cache.find(ch => ch.name === "guide-log")
logChannel.send({embed: globalFunctions.logAction(message.author.username, message.author.id, 'Approve', embedMessage.fields[approveMsgIndex].value, categoryMsg[0].categoryTitle)})
Expand Down
6 changes: 3 additions & 3 deletions Commands/delete.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const {dbClient} = require("../mongodb.js")
const globalFunctions = require("../globalfunctions.js")
const {noAlias, cancelAlias} = require("../constants.js")
const post = require("../post.js")
// const post = require("../post.js")

module.exports = {
name: 'delete',
Expand Down Expand Up @@ -74,7 +74,7 @@ module.exports = {
logChannel.send({embed: globalFunctions.logAction(message.author.username, message.author.id, 'Delete', sectionInfo, guideMsg[0].categoryTitle)})

guideDB.updateOne(identifier, {$set: {"embedMessage": guideMsg[0].embedMessage, "categoryTitle": guideMsg[0].categoryTitle, "messageID": guideMsg[0].messageID, "category": guideMsg[0].category}})
post.post(client, message, "", "Edit", guideMsg[0].embedMessage)
// post.post(client, message, "", "Edit", guideMsg[0].embedMessage)
// post function
return message.channel.send("Section deleted.")

Expand All @@ -94,7 +94,7 @@ module.exports = {
let logChannel = message.guild.channels.cache.find(ch => ch.name === "guide-log")
logChannel.send({embed: globalFunctions.logAction(message.author.username, message.author.id, 'Delete', "See below.", deleteChannel.name)})
logChannel.send({embed: guideMsg[0].embedMessage}).then(()=> guideDB.deleteOne({identifier}))
post.post(client, message, "", "Delete", guideMsg[0].embedMessage)
// post.post(client, message, "", "Delete", guideMsg[0].embedMessage)
// post function


Expand Down
8 changes: 4 additions & 4 deletions Commands/edit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const {dbClient} = require("../mongodb.js")
const globalFunctions = require("../globalfunctions.js")
const {yesAlias, noAlias, cancelAlias} = require("../constants.js")
const post = require("../post.js")
// const post = require("../post.js")

module.exports = {
name: 'edit',
Expand Down Expand Up @@ -48,7 +48,7 @@ module.exports = {
}
m.first().edit({embed: embedMessage}).then(me => {message.channel.send("ID: " + me.id)})
guidesDB.updateOne({"categoryTitle": { $regex: new RegExp(categoryTitle, "i") }}, {$set: {"embedMessage": embedMessage, "categoryTitle": categoryMsg[0].categoryTitle, "messageID": categoryMsg[0].messageID, "category": categoryMsg[0].category}})
post.post(client, message, "", "Edit", embedMessage)
// post.post(client, message, "", "Edit", embedMessage)
// post function
})

Expand Down Expand Up @@ -166,7 +166,7 @@ module.exports = {
if (m.first().id != categoryMsg[0].messageID[message.guild.id]) {
categoryMsg[0].messageID[message.guild.id] = m.first().id
guidesDB.updateOne({"categoryTitle": { $regex: new RegExp(categoryTitle, "i") }}, {$set: {"embedMessage": embedMessage, "categoryTitle": categoryMsg[0].categoryTitle, "messageID": categoryMsg[0].messageID, "category": categoryMsg[0].category}})
post.post(client, message, "", "Edit", embedMessage)
// post.post(client, message, "", "Edit", embedMessage)
// post function
//updates the ID if it does not match in the database
}
Expand All @@ -176,7 +176,7 @@ module.exports = {
let logChannel = message.guild.channels.cache.find(ch => ch.name === "guide-log")
logChannel.send({embed: globalFunctions.logAction(message.author.username, message.author.id, 'Edit', oldMessage, categoryMsg[0].categoryTitle)})
guidesDB.updateOne({"categoryTitle": { $regex: new RegExp(categoryTitle, "i") }}, {$set: {"embedMessage": embedMessage, "categoryTitle": categoryMsg[0].categoryTitle, "messageID": categoryMsg[0].messageID, "category": categoryMsg[0].category}})
post.post(client, message, "", "Edit", categoryMsg[0].categoryTitle)
// post.post(client, message, "", "Edit", categoryMsg[0].categoryTitle)
message.channel.send("Message edited.")

}
Expand Down
7 changes: 3 additions & 4 deletions Commands/raw.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const {dbClient} = require("../mongodb.js")
const globalFunctions = require("../globalfunctions.js")
const {yesAlias, noAlias, cancelAlias} = require("../constants.js")
const post = require("../post.js")
// const post = require("../post.js")

const processFile = (file, oldGuideMsg) => {
let fileLines = file.split("\n")
Expand Down Expand Up @@ -67,14 +67,13 @@ module.exports = {
//updates the ID if it does not match in the database
}
guidesDB.updateOne({"categoryTitle": { $regex: new RegExp(categoryName, "i") }}, {$set: {"embedMessage": guideMsg, "categoryTitle": categoryMsg[0].categoryTitle, "messageID": categoryMsg[0].messageID, "category": categoryMsg[0].category}})
post.post(client, message, "", "Edit", guideMsg)
// post.post(client, message, "", "Edit", guideMsg)
//post function
m.first().edit({embed: guideMsg}).then(me => {message.channel.send("ID: " + me.id)})
})

let logChannel = message.guild.channels.cache.find(ch => ch.name === "guide-log")
// logChannel.send({embed: globalFunctions.logAction(message.author.username, message.author.id, 'Edit', "See text file uploaded", categoryMsg[0].categoryTitle)})
logChannel.send({embed: globalFunctions.logAction("Jake Kizard", "191332103110131712", 'Edit', "Old Guide Message below.", categoryMsg[0].categoryTitle)})
logChannel.send({embed: globalFunctions.logAction(message.author.username, message.author.id, 'Edit', "See text file uploaded", categoryMsg[0].categoryTitle)})
logChannel.send({embed: categoryMsg[0].embedMessage})
//temprarily placed here to give credit for guides written in raw text format
return message.channel.send("Message edited.")
Expand Down
1 change: 0 additions & 1 deletion node_modules/.bin/semver

This file was deleted.

21 changes: 21 additions & 0 deletions node_modules/base64-js/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions node_modules/base64-js/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/base64-js/base64js.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions node_modules/base64-js/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

150 changes: 150 additions & 0 deletions node_modules/base64-js/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0d88588

Please sign in to comment.