Skip to content

Instantly share code, notes, and snippets.

@devsamuelv
Created April 19, 2022 05:08
Show Gist options
  • Save devsamuelv/eee78464ad7dec5f23f3f98e5f5767a1 to your computer and use it in GitHub Desktop.
Save devsamuelv/eee78464ad7dec5f23f3f98e5f5767a1 to your computer and use it in GitHub Desktop.
discord message automator
from time import sleep
from pynput import mouse, keyboard
m = mouse.Controller()
k = keyboard.Controller()
payload = input("message payload: ").split(" ")
print("you have five seconds.")
def on_press(key):
if key == keyboard.Key.esc:
return False
sleep(5)
m.press(mouse.Button.left)
with keyboard.Listener(on_press=on_press) as s:
for idx, i in enumerate(payload):
if s.running == False:
print("ESC Pressed exiting.")
exit()
k.type(i)
k.press(keyboard.Key.enter)
# this is to avoid rate limiting however this won't work for a prolonged period of spamming
sleep(0.1 * (idx / 2.4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment