Skip to content

Commit cefb8f3

Browse files
authored
Add files via upload
1 parent acb40ec commit cefb8f3

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

Pythhon-Chatbot/PythonChatBot.md.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# PythonSpamChatBot
2+
3+
Hey guys, I wanted to spam on my college whatsapp group after becoming tired of my examinations, thus I developed a basic bot for spamming using Python. While building the bot, I discovered something fascinating that I'd want to share.
4+
We’ll take a step by step approach and break down the process of building a Python chatbot.
5+
6+
# Outline
7+
* [Chatbot](#chatbot)
8+
* [Spam](#spamming)
9+
* [Installation](#installation)
10+
* [Pyautogui](#pyautogui)
11+
* [Steps](#steps)
12+
* [Python code](#python-code)
13+
* [Conclusion](#conclusion)
14+
15+
## ChatBot
16+
17+
A chatbot is a piece of AI-based software that can converse with humans in their own language. These chatbots often connect with humans through audio or written means, and they can easily mimic human languages to speak with them in a human-like manner. One of the most effective uses of natural language processing is a chatbot.
18+
19+
## Spamming
20+
Sending unsolicited messages to a large number of computers through the internet is known as spamming.
21+
This mini-project can be utilised for a variety of real-world scenarios, including:
22+
1. Remind your friends or relatives to complete a specific job at regular intervals.
23+
2. It's possible to use it for marketing purposes.
24+
25+
## Installation
26+
Installing the pyautgui package on your machine is the first step in developing a chatbot in Python. For the installation, it's preferable if you create and use a new Python virtual environment. To do so, type and run the following command in your Python terminal:
27+
28+
```python
29+
pip install pyautogui
30+
```
31+
## Pyautogui
32+
PyAutoGUI is a python module which lets your Python scripts control the mouse and keyboard to automate interactions with other applications. The API is designed to be simple. PyAutoGUI works on Windows, macOS, and Linux, and runs on Python 2 and 3.
33+
PyAutoGUI has several features:
34+
35+
1. Moving the mouse and clicking in the windows of other applications.
36+
2. Sending keystrokes to applications (for example, to fill out forms).
37+
3. Take screenshots, and given an image (for example, of a button or checkbox), and find it on the screen.
38+
4. Locate an application’s window, and move, resize, maximize, minimize, or close it (Windows-only, currently).
39+
5. Display alert and message boxes.
40+
41+
## Steps
42+
To start creating this Chatbot In Python Tutorial, make sure that you have Python IDE installed in your computer.
43+
1. Create a project name.
44+
2. Create a python file.
45+
3. Name your python file.
46+
4. Import module.
47+
5. Add delay of few second in the execution of the program.
48+
6. Create mechanism to generate text messages. typewrite() function of pyautogui helps to write the text and sleep function helps us specify the particular time interval (in seconds) after which the next instruction has to be executed.
49+
50+
## Python Code
51+
```python
52+
import pyautogui
53+
import time
54+
55+
time.sleep(2)
56+
57+
while True:
58+
59+
pyautogui.typewrite("This is spam Bot created using Python")
60+
pyautogui.press("enter")
61+
time.sleep(10)
62+
```
63+
## Conclusion
64+
What I've shown you here is only one of many approaches to create a chatbot in Python. You may also make a Python chatbot with NLTK, chatterbot, and pywhatkit, among other Python packages. And, while what I learnt here is a very simple Python chatbot with few cognitive skills, if you completely grasp the concept of a Python chatbot, you can experiment with it using various tools and instructions to make it even smarter.
65+
66+
## Contribution
67+
Pull requests are welcome. For major changes, please open and issue first to discuss what you would like to change.
68+
69+
Please make sure to update tests as appropriate.

Pythhon-Chatbot/pythonspambot.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# -*- coding: utf-8 -*-
2+
3+
import pyautogui
4+
import time
5+
6+
time.sleep(2)
7+
8+
while True:
9+
10+
pyautogui.typewrite("This is spam Bot created using Python")
11+
pyautogui.press("enter")
12+
time.sleep(10)

0 commit comments

Comments
 (0)