MySQL db making my brain implode

I have 3 files involved in this
7 Replies
d.js toolkit
d.js toolkit13mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
! MYA
! MYAOP13mo ago
first is bot.js
import fs from "node:fs"
import path from "node:path"
import db_compile from "./database-controls/db_compile.js"
import { Client, Collection, Events, GatewayIntentBits, messageLink } from "discord.js"

const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent] })

client.once(Events.ClientReady, c => {
console.log(`Ready! Logged in as ${c.user.tag}`)
})

client.on("guildCreate", guild => {
console.log(guild.name)

db_compile.DB_createServer(guild.id)
})

client.on("messageCreate", message => {
if (message.content === "?setchannel") {
db_compile.DB_setCounterChannel(message.guild.id, message.channel.id)
message.reply(`successfully set the counting channel to #${message.channel.name}`)
}

if (Number(message.content) >= 0) {
const result = db_compile.DB_queryCounterChannel(message.guild.id, message.channel.id)

if (result == message.channel.id) {
const lastNumb = db_compile.DB_queryCounterLastNumber(message.guild.id)


console.log(lastNumb)
/*
if (Number(message.content) = lastNumb + 1) {
db_compile.DB_setCounterLastNumber(Number(message.content) = lastNumb + 1, message.guild.id)
} else {
db_compile.DB_setCounterLastNumber(0, message.guild.id)
message.reply("L")
}
*/
}
}
})



// UPDATE serverdata SET `counterChannelId` = '342525' WHERE ;
import fs from "node:fs"
import path from "node:path"
import db_compile from "./database-controls/db_compile.js"
import { Client, Collection, Events, GatewayIntentBits, messageLink } from "discord.js"

const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent] })

client.once(Events.ClientReady, c => {
console.log(`Ready! Logged in as ${c.user.tag}`)
})

client.on("guildCreate", guild => {
console.log(guild.name)

db_compile.DB_createServer(guild.id)
})

client.on("messageCreate", message => {
if (message.content === "?setchannel") {
db_compile.DB_setCounterChannel(message.guild.id, message.channel.id)
message.reply(`successfully set the counting channel to #${message.channel.name}`)
}

if (Number(message.content) >= 0) {
const result = db_compile.DB_queryCounterChannel(message.guild.id, message.channel.id)

if (result == message.channel.id) {
const lastNumb = db_compile.DB_queryCounterLastNumber(message.guild.id)


console.log(lastNumb)
/*
if (Number(message.content) = lastNumb + 1) {
db_compile.DB_setCounterLastNumber(Number(message.content) = lastNumb + 1, message.guild.id)
} else {
db_compile.DB_setCounterLastNumber(0, message.guild.id)
message.reply("L")
}
*/
}
}
})



// UPDATE serverdata SET `counterChannelId` = '342525' WHERE ;
db.js
treble/luna
treble/luna13mo ago
this doesnt look djs related
! MYA
! MYAOP13mo ago
it is
treble/luna
treble/luna13mo ago
why is your title mysql then
! MYA
! MYAOP13mo ago
yehhhhh that maes sense
treble/luna
treble/luna13mo ago
and that last part definetly is not djs related
Want results from more Discord servers?
Add your server