Skip to content

UnknownDecoder/decoder-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DecoderBot 🤖

A lightweight Python chatbot that responds to messages using exact or close matches with difflib.

PyPI version License: MIT Made with ❤️ by Unknown Decoder


💡 What is DecoderBot?

DecoderBot is a simple Python class that lets you build a chatbot that replies to input messages based on:

  • Exact matches (like "hello")
  • Closest matches (like "helo""hello"), if difflib is available

No extra libraries. No nonsense. Just logic.


🚀 Features

  • 🧠 Exact and fuzzy response matching
  • 🛠️ Add or update responses easily
  • 📦 Zero external dependencies
  • 🔥 Lightweight and fast

🛠️ How to Use

1. Clone or download the chatbot.py file.

2. Import and use it in your project:

from DecoderBot import ChatBot

bot = ChatBot("Your Bot Name")

# Add a custom response
bot.train_for("yo", "What's up?")

# Get exact match response
print(bot.get_response("yo"))  # Output: What's up?

# Get a close match response (e.g. "helo" → "hello")
try:
    print(bot.get_closest_response("helo"))
except Exception as e:
    print(e)

OR

You can install it using the command pip install DecoderBot!

About

A lightweight Python chatbot that responds to messages using exact or close matches with `difflib`.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages