Skip to content

Tag: javascript

Import and execute all files on folder with es6

I am migrating some node ES5 node code to Typescript. I need to port these two pieces of code where I iterate through all the files in a directory and call the default function these files are exporting. How would I do that in Typescript or ES6? models/index.js index.js Answer You can do this with dynamic imp…

How to respond with embeds

Currently I am trying to work on my bot and update its responses. Right now I am trying to use the code below to make it respond with the random embeds I made. For some reason when doing using this code the bot either responds with “NaN” or “3”? Answer The purpose of: Is to generate a …

How can I fix this button

When I click on any button it shows same first button output. How can I fix it. I want it be different when I click on different button it should display same output that button has. I want it to be on my website. Answer Using nextElementSibling: