Skip to content

Author: admin@master

How to Play Audio File Into Channel?

How do you play an audio file from a Discord bot? Needs to play a local file, be in JS, and upon a certain message being sent it will join the user who typed the message, and will play the file to that channel. Answer GitHub Project: LINK In order to do this there are a few things you have

Using moment to format time in relation to now

I’m trying to display a date like “a few seconds ago”, “10 minutes ago”, “a day ago” with momentjs in the browser. date returns “in 14 minutes” NOT “14 minutes ago”. How can I fix this? Answer Because you would have been comparing it in that wa…

How to use ReactJS in Laravel

I am new to ReactJS and I am looking for a way to integrate it in Laravel. Is there any way that I can use React components within laravel views or it should be done only by using API as separate projects. Answer Use Laravel to provide the base view, but then after that all the views would be handled

How to convert node readable stream to RX observable

If I have a Node js stream, say for example from something like process.stdin or from fs.createReadStream, how can I convert this to be an RxJs Observable stream using RxJs5? I see that RxJs-Node has a fromReadableStream method, but that looks like it hasn’t been updated in close to a year. Answer For a…

Visual Studio Code: Run node script on save

I use Visual Studio Code (1.8.1) to write ECMAScript 6 for NodeJS 7.3 (so currently no TypeScript). I want to run the current script with node from the command line (node ${file}) every time the script file is saved. Is this possible? To be clear: NodeJS is not running as server, but used for executing cli sc…