Avatar issue example I am trying to do the discord.js avatar command and it works. It sends the image it needs to send but the issue is that the image sent is small compared to other bots. Am using the command handler in the discord.js guide Answer You can add a size option like how you did with you format
Tag: javascript
Before/After properties without change are not equal in firestore-triggered Cloud Function
I have a firestore collection called events that contains documents with the fields begin, end and title. The function is triggered if a document was changed. begin and end are of type timestamp. I want my function to return false if begin or end was changed. In my cloud function, I check if the respective be…
How to use click event on bootstrap modal
I generate many bootstrap modals with a php script, and I’d like to edit some input of it when I click button “save changes”. ModalIDs generated are something like “ModalID0000”. But nothing happens with my script when i click on “save changes”. EDIT : 1st mistake fou…
Im getting an error in my react and rest api app where one of my variables is coming back undefined
thank you for your time if youre reading this, im making a full stack app with react and rest api and im encountering an error as such: the part where this error is throwing is right here: heres my createUser function code: heres the code handiling post / users Im really not sure whats going on with my errors…
How to use a spread or map operator to apply this formula to an array of Uint16 pairs?
I’ve been trying to better understand the spread and/or map operator, specifically how to apply math using it. I have an array of two Uint16 number pairs like this: I would like to use the spread or map operator to apply the following formula to each pair. The formula combines the pair into Uint32, then…
JSX expressions must have one parent element.ts(2657) In Return statement
I’m trying to build a Tic Tac Toe app that will let me choose 3×3, 4×4 and 5×5 grid and currently i’m stuck on 3×3 grid and I’m getting ‘JSX expressions must have one parent element.ts(2657)’ I tried adding another view element but it didn’t work. I will…
getting error while deleting record in the table – method not allowed “405 (Method Not Allowed)”
i want to delete record using ajax call but im getting error method not allowed. 405 error. code HTML JS c# code Answer I test my code,and I find HTTPDelete and HttpPost can work. Here is a demo for HTTPDelete: View: controller: Result: Here is a demo for HTTPPost: View: controller: Result:
jasmine.createSpyObj with properties
When mocking dependencies in my Angular tests, I usually create a spy object using jasmine.createSpyObj: then provide it to the TestBed: When I use it in my test, I can then specify the desired return value: Now I also need to mock properties and I cannot find out how it should be done. createSpyObj does allo…
How to change shared state in Alpine.js?
I’m trying to hide multiple elements inside the DOM by changing shared state when window is resized. And when i try to It should change the state ** hideOnMobile** to true but it doesn’t somehow any idea? Answer Have you tried using @resize.window? (ie. adding the resize listener using Alpine.js) …
Image max height and max width while preserving aspect ratio
Is it possible to give max-height and max-width to an image while preserving aspect ratio without using js? For example, I want an image to be with a height of 38px and the width auto. If the width is higher than 200px, I want the width to be 200px and the height auto. If it’s not possible without js, d…