DEV Community

Cover image for Make Spam bot in Python in just 6 lines
VECTOR3Studio
VECTOR3Studio

Posted on

Make Spam bot in Python in just 6 lines

1 Hello πŸ‘‹
In this post I will show you how to make simple spam bot in Python in just 6 lines of code.

BTW you can watch video tutorial here:

So let's Start ▢️

First we need to install Pysimplegui library, we can do it by running this command

 pip install pysimplegui 
Enter fullscreen mode Exit fullscreen mode

Next, we need to import pysimplegui and time library. We can use this code

import pysimplegui, time
Enter fullscreen mode Exit fullscreen mode

Now let's make a program for spamming.
First we need add a timer, because you will need some time to go to Instagram or something.
Then we need ad a whole loop for the spamming functionality
Here is the code:

time.sleep(5) #delay for 5 sec
while True: #endless loop
  pyautogui.write("heyy")
  pyautogui.press("enter")
  time.sleep(0.2)
Enter fullscreen mode Exit fullscreen mode

That's the whole code you need to Spam your friend.

Thanks for Reading this post. I hope you learned something new. See you πŸ‘‹

Discussion (2)

Collapse
darkwiiplayer profile image
DarkWiiPlayer

A "spambot" can be lots of things and it took me quite a while to figure out what this actually achieves. Had to open the video to figure out what this does. Maybe it'd be best if you made it clearer that this emulates keyboard input for chat-apps?

Collapse
vector3studio profile image
VECTOR3Studio Author

Thanks for your opinion. I don't know why to stimulate it, but I will try