Skip to content

Commit

Permalink
Merge pull request #3 from SleepyYui/main
Browse files Browse the repository at this point in the history
Fix 3 errors
  • Loading branch information
docimin authored Jan 26, 2023
2 parents 87a7187 + cdc8cf6 commit 3a040a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
11 changes: 8 additions & 3 deletions bot/core/DatabaseManager.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
const mysql = require("mysql2");

module.exports = mysql.createConnection({
// changing one connection to a pool for better performance and to prevent the connection from being closed by the database
module.exports = mysql.createPool({
host : process.env.DATABASE_HOST,
user : process.env.DATABASE_USER,
password : process.env.DATABASE_PASSWORD,
database : process.env.DATABASE_DATABASE
});
database : process.env.DATABASE_DATABASE,
multipleStatements: true,
// keepAlive to try to prevent the connection from being closed by the database
keepAliveInitialDelay: 28799 // 1s less than 8 hours | default timeout when no activity is detected is 8 hours
});

2 changes: 1 addition & 1 deletion bot/core/TicketsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class TicketsManager {
style: 2,
min_length: 1,
max_length: 1000,
value: comment?.slice?.(0, 990) || "",
value: comment?.slice?.(0, 990) || null,
placeholder: "Z. B. \"Der Nutzer hat in #laberecke beleidigt\" oder \"Wie erhalte ich die Sub Rolle?\"",
required: true
}], }, { type: 1, components: [{
Expand Down
4 changes: 3 additions & 1 deletion bot/core/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ class Utils {
finalString += message?.content;

if (message?.embeds?.length > 0)
finalString += "\n" + this.getEmbedsAsString(message.embeds);
//finalString += "\n" + this.getEmbedsAsString(message.embeds);
// When links are sent and turn into an embed, the embeds array will contain the link as a string, which is the easiest way to save it
finalString += "\n" + message?.embeds?.url?.toString();

if (message?.attachments?.size > 0)
finalString += "\n" + message?.attachments?.map(a => a?.url)?.join(" ");
Expand Down

0 comments on commit 3a040a1

Please sign in to comment.