Skip to content

Instantly share code, notes, and snippets.

@kidsonfilms-python-rules
Created May 1, 2021 05:52
Show Gist options
  • Save kidsonfilms-python-rules/3949a005b0ab75af521c78e6e84c3917 to your computer and use it in GitHub Desktop.
Save kidsonfilms-python-rules/3949a005b0ab75af521c78e6e84c3917 to your computer and use it in GitHub Desktop.
Send Discord Message at certain time
var robot = require("robotjs");
// Put the message you want to send
const message = ''
// Set Date as (Year, Month 0-11, Day, Hour, Minute)
const eta_ms = new Date(2021, 3, 30, 22, 41).getTime() - Date.now();
console.log(`Sending Message in ${eta_ms}ms or ${new Date(Date.now() + eta_ms)}`)
var timeout = setTimeout(function(){
console.log('Sending Message')
robot.typeString(message);
robot.keyTap('enter')
console.log('Message Sent!')
}, eta_ms);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment