Mr. Spammer bot using Python

Mr. Spammer bot using Python

ยท

4 min read

Hello guys, today I will be telling you how to make a very simple but cool python bot.

In this blog it is considered that you have your pythons set up to the latest version.

I named this cool python bot as Mr. Spammer. Obviously this bot will not be of great use other than spamming a large set of text on any platform.
And yeah, this bot is just for educational purposes

and messing with your friends ๐Ÿ˜

Remember that Spamming is illegal, so don't mess with anyone except your friends . First step:- download the following python packages on your terminal

keyboard
pyautogui
time

you can download each of the package, in the same format as the code snippet below

pip install "package name"

using the following code you can install any python package on your system

Example

pip install keyboard

Note : Install these packages on your OS's native terminal . If you are using any IDE like pycharm and you are not able to use these packages, then try installing them again on the IDE's terminal.

Into to each of these packages/modules :

keyboard -

It helps to enter keys, record the keyboard activities and block the keys until a specified key is entered and simulate the keys. It captures all keys, even onscreen keyboard events are also captured. Keyboard module supports complex hotkeys. Using this module we can listen and send keyboard events.

learn more about the package on the following sites-

pypi.org/project/keyboard

geeksforgeeks.org/keyboard-module-in-python...

pyautogui -

PyAutoGUI lets Python control the mouse and keyboard, and other GUI automation tasks. For Windows, macOS, and Linux, on Python 3 and 2.

learn more about it on -

pypi.org/project/PyAutoGUI/#:~:text=PyAutoG...

time

As you can notice the name the Python time module provides many ways of representing time in code, such as objects, numbers, and strings. It also provides functionality other than representing time, like waiting during code execution and measuring the efficiency of your code.

This module will help in controlling the time delay between each word.

learn more about it on -

realpython.com/python-time-module/#:~:text=...

Setting up the spam file

Open your browser and look your the longest and most suitable text. I personally used the dialogue script of the Bee Movie(you can find that in the link below)

script-o-rama.com/movie_scripts/a1/bee-movi..

After finding the best text, store that in a .txt file and place it the same directory as that of the python code file. the directory of the text file and the code file should be same. in my case the name of file is beespam.exe

Code

After installing the packages, you can use the following code snippet on your ide. Read the respective comments to understand the use of each function.

#importing required packages
import keyboard
import pyautogui  
import time

time.sleep(5)  #delaying the program so that it doesn't spam on any undesired platform and you get time to switch to the desired platform 

f = open("beespam.txt", 'r')  #change beespam.txt with any other text file contaning a long spammable message
#loop 
for word in f:
    if not keyboard.is_pressed('s'):  #the program will terminate if you press 's' for 1sec
        pyautogui.typewrite(word)     #controls the keyboard and types the text
        pyautogui.press("enter")     
       time.sleep(1) #delay of 1 sec between every message

NOTE- You will have to keep the screen open and the cursor once clicked on the text box on the platform where you have to spam. Your bot will stop once you press 's' (or any other key you selected) or when the whole text finishes

Keep in mind that spamming on any unauthorized or any official government websites may lead to account bans or legal actions. So better never try that. I will not be responsible for any of suck situations.

Link to my github repository for the Mr. Spammer bot :

github.com/Kushagra-Jain99/MrSpammer

Now go and open your friends direct message and spam ๐Ÿ˜‚

Hope you learned something new :))

For any queries or suggestions, please feel fell to comment below or mail me at

Have a good day ๐Ÿ˜Š