Home

Awesome

šŸÆ honeybot py [ docs ]

<div align="center"> <img src="./assets/honeybot_real.png" width="64" />

PyPI version First Timers Only Open Source Love Made in Moris CII Best Practices OpenSSF Scorecard

Launching pyhoneybot Rewards

Contributed to pyhoneybot? Here is a big thank you from our community to you. Claim your badge and showcase them with pride. Let us inspire more folks !

pyhoneybot Badges

Claim Now!

<hr> šŸ‡²šŸ‡ŗ šŸ‡ŗšŸ‡ø šŸ‡ØšŸ‡¦ šŸ‡¦šŸ‡· šŸ‡®šŸ‡³ šŸ‡¬šŸ‡§ šŸ‡¬šŸ‡¬ šŸ‡§šŸ‡· šŸ‡øšŸ‡½ šŸ‡µšŸ‡± šŸ‡©šŸ‡Ŗ šŸ‡²šŸ‡¼ šŸ‡²šŸ‡¦ </div> <div align="center">

Open Source Helpers Discord

</div>

Table of Contents

šŸ“® About

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!

šŸ•¹ Project Motivation

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.

āœ‚ Current Features

:mountain: GUI clients

GUI clients are used to manage plugins, launch bot as well as specify credentials.

āŒš Current Plugins

PluginDescriptionContributor
šŸ’Ž bitcoinGet price of bitcoin@Macr0Nerd
ā² caesar cipherEncode your text@kylegalloway
šŸ”¢ calcEvaluates maths expressions@Abdur-rahmaanJ
šŸ“ mathsTrigonometry & random number generator@Abdur-rahmaanJ
šŸƒ conv sniffSet triggers like how many times a word occur for one or more words and send response@Abdur-rahmaanJ
ā„ greetDemo plugin@Abdur-rahmaanJ
ā›“ installed_modulesChecks dependencies installed@Abdur-rahmaanJ
šŸ•¶ jokeGet random joke@Abdur-rahmaanJ, @colbyjayallen
ā“ self TriviaRandom trivia@ajimenezUCLA
šŸ’¢ usernameUsername generator@Abdur-rahmaanJ, @sseryani
šŸ“œ quotesInspirational quotes@German-Corpaz
šŸ“– dictionaryReturns meaning of word@iamnishant14
šŸ”£ password generatorThe name tells it all@iamnishant14
šŸœ debugPrints all parameters passed to bot@Abdur-rahmaanJ
šŸ“š wikipediaReturns a wikipedia article@Macr0Nerd
šŸ—æ translateGoogle translate plugin@a-deeb
šŸ“‘ testRuns tests@Abdur-rahmaanJ
ā›…ļø weatherReturns weather info for a given location@Macr0Nerd
āœ‰ļø mailSend emails within the chat@TannerFry
šŸ•“ļø hangmanPlay hangman in the chat@JustinWalker4179
šŸŽ‚ ageTakes in birthday and outputs age@JustinWalker4179
āœ”ļø factReturns a random fact@JustinWalker4179
šŸ” googleReturns three search results from google@JustinWalker4179
šŸ“® send messageSends a message to another channel@JustinWalker4179
šŸ“ logLogs the chat into a log file@RiceAbove
šŸšŖ joinsGreets everyone who joins the channel@RiceAbove
šŸ“… datePosts the current date@RiceAbove
šŸ•µļøā€ riddleReturns a random riddle@AngeloGiacco
šŸ—ž newsGets the top 10 headlines from bbc world news@AngeloGiacco
šŸ“ horoscopeGets your daily horoscope for your starsign@AngeloGiacco
šŸ’µ currency converterConverts currencies@AngeloGiacco
šŸ”« russian_rouletteMay or may not kick you off the channel@AngeloGiacco
šŸØ monopolyHoneybot now supports the world's worst game!@AngeloGiacco
āš½ļø transfer_rumourShows the day's transfer rumours@AngeloGiacco
šŸƒ blackjack/21Play 21 on honeybot!@AngeloGiacco
šŸ¤’ coronaGet the latest news on coronavirus with honeybot!@AngeloGiacco
šŸ“– diaryKeep a diary with honeybot@AngeloGiacco
šŸ›© flightGets flight info from flightradar24@AngeloGiacco
šŸŽ² rollRolls a dice@GlennToms
ā“ helpShow link to plugin's information page@edumello
āœ… channeljoinJoin command for bot@marceloyb
:page_with_curl: comicReturns a random comic@mboekhold
šŸ“ todoMakes a to do list@h-ranjan1110
šŸŽ± Magic 8 BallAnswer questions using magic 8 ball@ZakariaTalhami
šŸŽŸ Random ExcuseGenerates a random excuse for you.@rakeshseal0
šŸ¦† DuckDuckGo SearchSearch queries in duckduckgo and return abstract.@rakeshseal0
šŸ–¼ Random ImageReturns a random image url.@rakeshseal0
šŸ›¢ URL ShortenerShortens a url@rakeshseal0
šŸ˜ emojiReturns emoji meaning@deadex-ng
šŸŽ‚ birthdayShows birthday match probability on a people group.@paulosgf
šŸ€ basketballShows information about the medals of euroBasket and Basketball world cup@kefthymic
šŸŽ¬ movies_imdbReturns certain information about a certain movie or shows 250 all time best movies@ZoeyKats

āš” Quickstart

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/CONNECT.conf

[INFO]

server_url = irc.libera.chat
port = 6667
name = appinventormuBot

In settings/PLUGINS.conf listed plugins under plugins/downloaded will load. Plugins listed under plugins/core are auto loaded.

šŸ’» Seeing The Bot In Action

Get an IRC client

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

Docker

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

šŸ”§ Plugins Development

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)

parameter1: incoming

incoming is the raw line and is not used except if you are not satisfied with the already provided methods

parameter2: 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>')

parameter3: info (meaning message info)

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

bot info

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

wrapping up

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)

šŸ“ƒ Contributing Guide

https://pyhoneybot.github.io/honeybot/How_Tos/contributing.html

Check out Contributing to get started on contributing.

šŸ”Œ Todo Plugins

ā˜‘ Allowing Plugins

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

šŸ“§ Contact (Including vulnerabilities)

Email

šŸ–Š Credits