Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const five = require("johnny-five");
- const Discord = require("discord.js");
- var Client = new Discord.Client();
- var board = new five.board();
- var LedBoolean = false;
- board.on("ready", () =>{
- let led = new five.led(13) // 13 must be the input number that you plugged the LED in.
- client.on("message", async m => {
- if(m.content.toLowerCase() === "boop") {
- if(LedBoolean === false) {
- await led.on()
- m.channel.send("Led is turned on!")
- LedBoolean = true;
- } else {
- await led.off()
- m.channel.send("Led is turned off!")
- LedBoolean = false;
- }
- }
- })
- })
- client.login("Your Super Cool Token ('cuz tokens are so gud, they must be kept secret.)")
Add Comment
Please, Sign In to add comment