D
D
delooop2019-08-30 16:01:01
JavaScript
delooop, 2019-08-30 16:01:01

How can I notify my discord bot of some client event?

The task is this: the Discord bot, when pressing a key on the keyboard on the user's computer (the creator of the discord server), must do something (in my case, include a specific .mp3 file).
I have an application that listens for a specific key being pressed (using the iohook module):

const ioHook = require('iohook');
ioHook.on("keypress", event => {
  // Numpad 0
  if(event.rawcode === 96) {
    
  }
});

ioHook.start();

How can I notify my discord bot that a key has been pressed on the client and the bot needs to execute a certain command?
There is an option with websockets, but it seems to me that this will not be very optimized, so I thought that
node-fetch could be used, but I do not quite understand where I should send the request.
The bot, if anything, is on Heroku.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question