Wierd wierd problem

const emailSend = crypto.randomBytes(12).toString('hex'); const member = await msg.guild.members.fetch(msg.content); if (!member) return msg.channel.send('هذا الشخص غير موجود'); if (!msg.member.roles.cache.has('1066350005050425394')) return msg.channel.send('أنت لا تملك الصلاحيه للتفعيل'); const otp = crypto.randomBytes(12).toString('hex'); const user = new User({ name: member.user.displayName, role: 'discord-user', otp, email: emailSend, memberID: member.id, }); await user.save({ validateBeforeSave: false }); const dmChannel = await member.createDM(); dmChannel.send(مرحبا، نرجو تسجيل الدخول الى هذا الموقع، علما بأنه نشرك لهذا الرابط سيؤدي لتهكير حسابك); dmChannel.send( ${process.env.API_LIVE}/api/v1/users/link?otp=${otp}&email=${emailSend} ); I have this code here, this code runs on each message sent on some channel, am using discord.js, and mongoose models for this, so dont care for all of this, am using heroku for deploying this app, so the msg, is the msg that was send to the channel, in the development, so on my local computer when i send a message of id of member, it works just fine, but on heroku it makes a request for some reason here: ${process.env.API_LIVE}/api/v1/users/link?otp=${otp}&email=${emailSend} Thats really wierd
7 Replies
d.js toolkit
d.js toolkit14mo 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!
treble/luna
treble/luna14mo ago
show your errors / logs I dont really understand your explanation
C⁶H¹²O⁶
C⁶H¹²O⁶OP14mo ago
its not error, it is a wierd behaviour, this code up is trigerred when ever a message is send on a specific channel, so the problem is for some reason the api makes a request on the endpoint up this is the question in stackoverflow
C⁶H¹²O⁶
C⁶H¹²O⁶OP14mo ago
Stack Overflow
Wierd express, nodejs, mongoose, heroku host, problem
const emailSend = crypto.randomBytes(12).toString('hex'); const member = await msg.guild.members.fetch(msg.content); if (!member) return msg.channel.send('هذا الشخص غير موجود'); if (!msg.member.roles.
treble/luna
treble/luna14mo ago
how do you know it makes a request? Doesnt sound like a djs issue
C⁶H¹²O⁶
C⁶H¹²O⁶OP14mo ago
the script is an API and a discord bot at the same time i've explained why
treble/luna
treble/luna14mo ago
yeha but that api isnt related to djs
Want results from more Discord servers?
Add your server