๐ฏ honeybot py [ docs ]
๐ฒ๐บ ๐บ๐ธ ๐จ๐ฆ ๐ฆ๐ท ๐ฎ๐ณ ๐ฌ๐ง ๐ฌ๐ฌ ๐ง๐ท ๐ธ๐ฝ ๐ต๐ฑ ๐ฉ๐ช ๐ฒ๐ผ ๐ฒ๐ฆ
- ๐ฎ About
- ๐น Project Motivation
- โ Current Features
- โฐ๏ธ GUI clients
- โ Current Plugins
- โก Quickstart
- ๐ป Seeing The Bot In Action
- Docker
- ๐ง Plugins Development
- ๐ Contributing Guide
- ๐ Todo Plugins
- โ Allowing Plugins
- ๐ญ Project Testimonials
- ๐ง Contact (Including vulnerabilities)
- ๐ Credits
HoneyBot is a python-based IRC bot. (python3.7) | If you want to just run the bot, go to the quick start section
HoneyBot is my first time collaborating to an open source project and I'm loving it. Before discovering HoneyBot, I was very intimidated on the idea of working with other people and had no idea what an IRC even was. Now I realize how much fun and rewarding it is to work together on a project with dedicated and friendly individuals. The documentation is easy to follow and everyone is super helpful. I highly recommend any new programmer who want to contribute on an open source project to try out HoneyBot. Personally I enjoy working on this project more than my own schoolwork. --@RiceAbove
Feel free to contribute to the project!
Implementing the project in Java was weird, py's connect was sleek. Thus, the project stack was shifted over to Python. If you can think of any features, plugins, or functionality you wish to see in the project. Feel free to add it yourself, or create an issue detailing your ideas. We highly recommend you attempt to implement it yourself first and ask for help in our discord server !
Psst. Since I learnt py through this bot, we decided to keep a new-comers friendly policy. Feeling lost? Just ping.
- ๐ฌ OOP architecture
- ๐ฐ๏ธ keyword parameters
- ๐ต password security with config file [disabled for now]
- ๐ now with plugins
GUI clients are used to manage plugins, launch bot as well as specify credentials.
Plugin | Description | Contributor |
---|---|---|
๐ bitcoin | Get price of bitcoin | @Macr0Nerd |
โฒ caesar cipher | Encode your text | @kylegalloway |
๐ข calc | Evaluates maths expressions | @Abdur-rahmaanJ |
๐ maths | Trigonometry & random number generator | @Abdur-rahmaanJ |
๐ conv sniff | Set triggers like how many times a word occur for one or more words and send response | @Abdur-rahmaanJ |
โ greet | Demo plugin | @Abdur-rahmaanJ |
โ installed_modules | Checks dependencies installed | @Abdur-rahmaanJ |
๐ถ joke | Get random joke | @Abdur-rahmaanJ, @colbyjayallen |
โ self Trivia | Random trivia | @ajimenezUCLA |
๐ข username | Username generator | @Abdur-rahmaanJ, @sseryani |
๐ quotes | Inspirational quotes | @German-Corpaz |
๐ dictionary | Returns meaning of word | @iamnishant14 |
๐ฃ password generator | The name tells it all | @iamnishant14 |
๐ debug | Prints all parameters passed to bot | @Abdur-rahmaanJ |
๐ wikipedia | Returns a wikipedia article | @Macr0Nerd |
๐ฟ translate | Google translate plugin | @a-deeb |
๐ test | Runs tests | @Abdur-rahmaanJ |
โ ๏ธ weather | Returns weather info for a given location | @Macr0Nerd |
โ๏ธ mail | Send emails within the chat | @TannerFry |
๐ด๏ธ hangman | Play hangman in the chat | @JustinWalker4179 |
๐ age | Takes in birthday and outputs age | @JustinWalker4179 |
โ๏ธ fact | Returns a random fact | @JustinWalker4179 |
๐ google | Returns three search results from google | @JustinWalker4179 |
๐ฎ send message | Sends a message to another channel | @JustinWalker4179 |
๐ log | Logs the chat into a log file | @RiceAbove |
๐ช joins | Greets everyone who joins the channel | @RiceAbove |
๐ date | Posts the current date | @RiceAbove |
๐ต๏ธโ riddle | Returns a random riddle | @AngeloGiacco |
๐ news | Gets the top 10 headlines from bbc world news | @AngeloGiacco |
๐ horoscope | Gets your daily horoscope for your starsign | @AngeloGiacco |
๐ต currency converter | Converts currencies | @AngeloGiacco |
๐ซ russian_roulette | May or may not kick you off the channel | @AngeloGiacco |
๐จ monopoly | Honeybot now supports the world's worst game! | @AngeloGiacco |
โฝ๏ธ transfer_rumour | Shows the day's transfer rumours | @AngeloGiacco |
๐ blackjack/21 | Play 21 on honeybot! | @AngeloGiacco |
๐ค corona | Get the latest news on coronavirus with honeybot! | @AngeloGiacco |
๐ diary | Keep a diary with honeybot | @AngeloGiacco |
๐ฉ flight | Gets flight info from flightradar24 | @AngeloGiacco |
๐ฒ roll | Rolls a dice | @GlennToms |
โ help | Show link to plugin's information page | @edumello |
โ channeljoin | Join command for bot | @marceloyb |
๐ comic | Returns a random comic | @mboekhold |
๐ todo | Makes a to do list | @h-ranjan1110 |
๐ฑ Magic 8 Ball | Answer questions using magic 8 ball | @ZakariaTalhami |
๐ Random Excuse | Generates a random excuse for you. | @rakeshseal0 |
๐ฆ DuckDuckGo Search | Search queries in duckduckgo and return abstract. | @rakeshseal0 |
๐ผ Random Image | Returns a random image url. | @rakeshseal0 |
๐ข URL Shortener | Shortens a url | @rakeshseal0 |
๐ emoji | Returns emoji meaning | @deadex-ng |
๐ birthday | Shows birthday match probability on a people group. | @paulosgf |
๐ basketball | Shows information about the medals of euroBasket and Basketball world cup | @kefthymic |
๐ฌ movies_imdb | Returns certain information about a certain movie or shows 250 all time best movies | @ZoeyKats |
โฉ๏ธ anime | Returns certain information about the top 100 anime | @cdkontos |
setup
mkdir botx
cd botx
python -m venv venv
venv\scripts\activate # or source venv/bin/activate for linux
python -m pip install honeybot
run
honeybot init
honeybot run
in settings/settings.toml
[INFO]
server_url = irc.libera.chat
port = 6667
name = appinventormuBot
In settings/settings.toml listed plugins under PLUGINS/downloaded will load. Plugins in directory plugins/core are auto loaded.
Get an IRC client
- Web: Kiwiirc (easy)
- Desktop: Hexchat
- Android: Revolution IRC
configure
port: 6667
url: irc.libera.chat
then join channel #ltch
you should see the bot as hbot ... or as it's name is in settings
Building Docker image
Change SERVER, PORT and NICKNAME variables to match your preferences
docker build -t "honeybot/honeybot:6.0.2" .
Running Docker image
docker run -d --name=honeybot honeybot/honeybot:v6.0.2 honeybot run
Each plugin has a folder named after it. In it there is a file called main.py. In each there is a class called Plugin.
# -*- coding: utf-8 -*-
class Plugin:
def __init__(self):
pass
def run(self, incoming, methods, info, bot_info):
try:
if info['command'] == 'PRIVMSG' and info['args'][1] == '.hi':
methods['send'](info['address'], 'hooo')
except Exception as e:
print('woops plugin error ', e)
we see four parameters being passed to the run method , incoming, methods, info, bot_info)
incoming
is the raw line and is not used except if you are not satisfied with the already provided methods
methods
is a dictionary of methods to ease your life. a quick look at main.py reveals
def methods(self):
return {
'send_raw': self.send,
'send': self.send_target,
'join': self.join
}
where send_raw
allows you to send in any string you want, thereby allowing you to implement any irc protocol from scratch
but, for most uses, send
allows you to send a message to an address methods['send']('<address>', '<message>')
. using it in conjunction with info parameter allows you to send messages where it came from, in pm to the bot or in a channel. you can however hardcode the address.
join
allows you to join a channel by methods['join']('<channel name>')
for a normal run, info produces
{
'prefix': 'appinv!c5e342c5@gateway/web/cgi-irc/kiwiirc.com/ip.200.200.22.200',
'command': 'PRIVMSG',
'address': '##bottestingmu',
'args': ['##bottestingmu', 'ef']
}
hence if you want messages, messages = info['args'][1:]
or the first word if you want to check for command will be info['args'][1]
use example
- the command info is used in the join channel plugin to detect a join command and greet the user who just joined
bot_info returns info about the bot
return {
'name': self.name,
'special_command': self.sp_command,
'required_modules': self.required_modules,
'owners': self.owners,
'time': self.time,
'friends': self.friends
}
so that in run method you can access those.
use example
- For example, the time info is used in the uptime plugin by minussing it from the current time to get time bot has been running.
- The required modules is used in the installed plugin to determine what required plugin the bot runner did not install
hence
if info['command'] == 'PRIVMSG' and info['args'][1] == '.hi':
methods['send'](info['address'], 'hooo')
from above means
if message received == .hi:
send(address, message)
https://pyhoneybot.github.io/honeybot/How_Tos/contributing.html
- don't forget to add your country flag here after accepted PR. i'll have to hunt it down on your profile if not.
- make sure to follow PEP8
Check out Contributing to get started on contributing.
- ๐ humour
- ๐จ๏ธ weather
- โ๏ธ mail
- ๐๏ธ maths
- ๐ฅ pm when user online
- Random Colour
Plugins available https://pyhoneybot.github.io/honeybot/plugins.html
in settings/settings.toml, add the plugin to allow!
[PLUGINS]
downloaded = ["greet",] # Downloaded plugins to load
- Abdur-Rahmaan Janhangeer | [email protected]
- @arwinneil, "Open Source" and "Made In Moris" badges