I just started coding my Discord bot and I made a command that replies to every message that isn’t sent by a bot. When I tried it in DMs it works fine, but when I tried it in my server it would mention the user before the command. In the DM it would say just “test”, but in the server
Tag: node.js
Unable to get __dirname value
I am using __dirname to get absolute path to GraphQL schema: I have changed module to fit ES6 module standard and __dirname now is undefined. How can I resolve path to schema? Answer There is some issue with esm + __dirname https://nodejs.org/api/esm.html#esm_no_require_exports_module_exports_filename_dirname…
How to get brackets value from a document / string in node.js
I am trying to get the value inside the brackets of a string. for example: how am I be able to get the value inside the brackets (job, age and name)? I actually use doctemplater npm to fill data to my document template. But since the template will vary, I need to know which value is required to be inserted
How we can intergrate Qr code monkey api to an express.js backend
Intergrate this for https://rapidapi.com/qrcode-monkey/api/custom-qr-code-with-logo For this code const express = require(‘express’); const http = require(“https”); const router = express.Router(); router.post(‘/’,async (req,res)=>{ console.log(“req”,req.body…
Is this bad practice for res.locals? (Node.js, express)
I was wondering if using res.locals like in this code example is bad practice or if there can occur any problems if you use it this way: Basically I: I verify the session-cookie in app.use (Im using firebase auth) I set the res.locals.userId = userId And then use the local i just set in the app.get (I need to…
how to insert a youtube iframe in a Node JS project? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I’m doing a project with Node Js and I know very little. I would like…
Extract the price only from api using node-fetch array
I am sorry for a basic question, I have been trying to extract only the price using node-fetch from API The error I am receiving is Please, any suggestion is greatly appreciated Answer There are several things that you need to check out Errors reagarding cjs/loader.js have little or nothing to do with your co…
Simple Tutorial code not getting data from a Login form (express js)
So I am following a YouTube Tutorial on how to set up a simple login server (channel name: web dev simplified, video: “Node.js Passport Login System Tutorial”) The code (at the stage I am at @ 14:12 mark in video) is suppose to console-log an array of a new registered user at the terminal. but I g…
Can’t upload picture to MongoDb from React frontend
I’m creating a tinder clone, I can create a user fine however I cant upload a picture. The error I get is ValidationError: User validation failed: pictures: Cast to embedded failed for value “‘picture’” at path “pictures”. I’m not sure what I’m doing wrong. The …
Why Table Storage support is no included the new new Azure ADK for JS?
Microsft released azure-sdk-for-js a long time back but still, there is no plan to support Table Storage. The only option for Table storage from NodeJS is legacy azure-storage-node. Is Microsoft trying to retire Table Storage in long term? Answer Accoring to this update on azure storage table sdk seems not su…