So basically I have been making an log for message edit. The aim of the function is to write in modlog channel if someone edits the message. Also I wanted bot to write message before and after update. Here is the code: The console error : What the bot does: -Bot executes the function exactly as planned. I have all
Tag: javascript
value of using React.forwardRef vs custom ref prop
I see that React.forwardRef seems to be the sanctioned way of passing a ref to a child functional component, from the react docs: However, what is the advantage of doing this over simply passing a custom prop?: The only advantage I can think of is maybe having a consistent api for refs, but is there any other advantage? Does passing
How can I send an code block in discord.js embed?
I am trying to send an embed with a codeblock. In discord a code block is set with three ` What can I do to put oldMessage.cleanContent and newMessage.cleanContent in a code block? Here is my code: Answer You can do it in two ways both are correct: You just comment the comma with quotation Or you can comment it
Query not working with SQL Template Strings npm
I’m trying to use the sql template strings npm package to use template literals in my SQL queries securely, but I keep getting an error that states that there is a problem with the sql syntax. When I omit the “SQL” bit, everything works. I’ve installed the sql-template-strings package. What am I missing? Help appreciated! Error I get: You have
Is it possible to add a request header to a CORS preflight request?
I have a website that accesses an API from an external server (not the server that serves the website) via a plain XmlHttpRequest (see below). That API requires an API key for accessing the service to be added as request header. However, as these are CORS requests the browser first does a preflight request to check if that server supports
Recurring Countdown Timer – Every 10 Minutes Based On Actual Time
I am trying to create a countdown timer that will continually count down to the nearest 10 minute interval of real time. So if a user lands on the page at 4:01pm it would count down 9:00 and then reset when it hits 0. But the time would always be relative to actual time. This is what I have so
How to group and sort data array in javascript?
Here is the json data in which the quarter is in descending order. I would like to maintain the descending order of quarter always. How do I sort by value or dateCreated? Answer You can create your own reusable sort function:
How do I turn on the webview autocomplete for an login form in Ionic’s capacitor in iOS?
I want to know how to enable the autocomplete for a login form in Capacitor (or if it’s possible). I’m using Ionic React. It works if access the page in Safari on iOS and even if you pin it to the home screen. But if you bundle the web app in Capacitor, the autocomplete is not there. Here’s the code
Determine how many integers, starting from the number 1, need to be added so that the sum will equal more than 100? Using JavaScript
I am trying to find a solution to this task “Determine how many integers, starting from the number 1, need to be added so that the sum will equal more than 100.”using JavaScript. I have my solution but I tend to feel that it is wrong. Could you please help me? I do not even realize if I understand the
In my HTML page justify-content-between not working
Sorry for the question, but I am new in bootstrap, in my user.js file I could not make it work to deploy justify-content-between Instead my two elements are next to each other like I used justify-content-start here are my codes: Answer At the end I understand that in my public/index.html file in section had not correct links to bootstrap links.