Code Monkey home page Code Monkey logo

honeybot's Introduction

โš ๏ธ moved to github.com/pyhoneybot/honeybot โš ๏ธ

first-timers-only Open Source Love Open Source Love MadeinMoris

๐Ÿฏ honeybot py

๐Ÿ“ฎ About

HoneyBot is a python-based IRC bot. (python3)

Feel free to contribute to the project!

alt text

๐Ÿ•น 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.

๐Ÿ“Œ Contributing Countries

๐Ÿ‡ฒ๐Ÿ‡บ ๐Ÿ‡บ๐Ÿ‡ธ ๐Ÿ‡จ๐Ÿ‡ฆ ๐Ÿ‡ฆ๐Ÿ‡ท ๐Ÿ‡ฎ๐Ÿ‡ณ ๐Ÿ‡ฌ๐Ÿ‡ง ๐Ÿ‡ฌ๐Ÿ‡ฌ ๐Ÿ‡ง๐Ÿ‡ท ๐Ÿ‡ธ๐Ÿ‡ฝ

๐Ÿ“จ Follow the project on CodeTriage for updates!

get issues delivered in your inbox.

Open Source Helpers

Discord

https://discord.gg/E6zD4XT

๐Ÿ’ญ Project Testimonials

@TannerFry

With experience in programming in Python, and implementing an SMTP email plugin for a different system, picking up HoneyBot and following the documentation provided for new-comers made it very simple to implement the same SMTP email plugin to the HoneyBot system. This was my first time contributing to an open-source project on GitHub and it was an overall great experience. The welcoming of new contributors and documentation on how to contribute and implement plugins is great for people who have never contributed to a project before, and Abdur-Rahmaan Janhangeer was extremely helpful when answering my questions and helping me along the way.

@RiceAbove

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.

@justinwalker4179

HoneyBot is my first open source project and I had never worked with an IRC before. For school I was required to contribute to projects, but it was always so intimidating to me. I had always heard it gets easier once you've gotten over the fear wall, and that's what HoneyBot did for me. Excellent readme and quick feedback allowed me to make my first plugin. Now I've made many contributions, and look forward to any new issues I can get my hands on. Abdur-Rahmaan Janhangeer has been extremely helpful and I owe him and this project a lot for getting me into the open source world.

@mboekhold

HoneyBot is a very friendly and welcoming community. They provided quick feedback and I would defenitely recommend this project to newcomers to give them that first boost on contributing to open source. HoneyBot helps you all the way there to issuing your first PR, step by step. I contributed a comic plugin, and I was thankful for meeting all the friendly and passionate people who are active in this community.

โœ‚ Current Features

  • ๐Ÿฌ OOP architecture
  • ๐Ÿ›ฐ๏ธ keyword parameters
  • ๐ŸŒต password security with config file [disabled for now]
  • ๐Ÿ”Œ now with plugins

โŒš Current Plugins

  • ๐Ÿ’Ž bitcoin by @Macr0Nerd - get price of bitcoin
  • โฒ caesar cipher by @kylegalloway - encode your text
  • ๐Ÿ”ข calc by @Abdur-rahmaanJ - evaluates maths expressions
  • ๐Ÿ“ maths by @Abdur-rahmaanJ - sin cos and the like
  • ๐Ÿƒ conv sniff by @Abdur-rahmaanJ - set triggers like how many times a word occur for one or more words and send response
  • โ„ greet by @Abdur-rahmaanJ - demo plugin
  • โ›“ installed_modules by @Abdur-rahmaanJ - checks dependencies installed
  • ๐Ÿ•ถ joke by @Abdur-rahmaanJ, @colbyjayallen - get random joke
  • โ“ self Trivia by @ajimenezUCLA - random trivia
  • ๐Ÿ’ข username by @Abdur-rahmaanJ, @sseryani - username generator
  • ๐Ÿ“œ quotes by @German-Corpaz - inspirational quotes
  • ๐Ÿ“– dictionary by @iamnishant14 - returns meaning of word
  • ๐Ÿ”ฃ password generator by @iamnishant14 - the name tells it all
  • ๐Ÿœ debug by @Abdur-rahmaanJ - prints all parameters passed to bot
  • ๐Ÿ“š wikipedia by @Macr0Nerd - returns a wikipedia article
  • ๐Ÿ—ฟ translate by @a-deeb - google translate plugin
  • ๐Ÿ“‘ test by @Abdur-rahmaanJ - runs tests
  • โ›…๏ธ weather by @Macr0Nerd - returns weather info for a given location
  • โœ‰๏ธ mail by @TannerFry - send emails within the chat
  • ๐Ÿ•ด๏ธ hangman by @JustinWalker4179 - play hangman in the chat
  • ๐ŸŽ‚ age by @JustinWalker4179 - takes in birthday and outputs age
  • โœ”๏ธ fact by @JustinWalker4179 - returns a random fact
  • ๐Ÿ” google by @JustinWalker4179 - returns three search results from google
  • ๐Ÿ“ฎ send message by @JustinWalker4179 - sends a message to another channel
  • ๐Ÿ“ log by @RiceAbove - logs the chat into a log file
  • ๐Ÿšช joins by @RiceAbove - greets everyone who joins the channel
  • ๐Ÿ“… date by @RiceAbove - posts the current date
  • ๐Ÿ•ต๏ธโ€ riddle by @AngeloGiacco - returns a random riddle
  • ๐Ÿ—ž news by @AngeloGiacco - gets the top 10 headlines from bbc world news
  • ๐Ÿ“ horoscope by @AngeloGiacco - gets your daily horoscope for your starsign
  • ๐Ÿ’ต currency converter by @AngeloGiacco - converts currencies
  • ๐Ÿ”ซ russian_roulette by @AngeloGiacco - may or may not kick you off the channel
  • ๐Ÿจ monopoly by @AngeloGiacco - Honeybot now supports the world's worst game!
  • โšฝ๏ธ transfer_rumour by @AngeloGiacco - shows the day's transfer rumours
  • ๐Ÿƒ blackjack/21 by @AngeloGiacco - play 21 on honeybot!
  • ๐ŸŽฒ roll by @GlennToms - rolls a dice
  • โ“ help by @edumello - show link to plugin's information page
  • โœ… channeljoin by @marceloyb - join command for bot
  • ๐Ÿ“ƒ comic by @mboekhold - returns a random comic

๐Ÿ”ง Plugins Development

including it here. let's begin

a plugin has the following structure:

# -*- coding: utf-8 -*-
"""
[greet.py]
Greet Plugin
[Author]
Abdur-Rahmaan Janhangeer, pythonmembers.club
[About]
responds to .hi, demo of a basic plugin
[Commands]
>>> .hi
returns hoo
"""


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 three parameters being passed to the run method , incoming, methods, 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

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]

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

  • 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

about PR

different changes to different files. for example, someone making a weather plugin first he creates a new branch

git checkout -b "weather-plugin"

then he commits

git add *
git commit -m "added weather plugin"

then he push to create a PR with the branch

git push origin head

now let us say he wants to work on another issue, adding a joke in the jokes plugin, he creates another branch

git checkout -b "add-jokes"

after, same as before

git add *
git commit -m "added some jokes"
git push origin head

now he wants to fix his weather plugin, he changes branch

git checkout weather-plugin

works, then commit

git add *
git commit -m "fixed <issue>"

then a PR

git push origin head

Why all these?

So as not to reject a whole PR just because of some oddities. Reject only unneeded part.

๐Ÿฅ„ Updating fork

Now, other changes are ongoing, what if you need the latest changes?

git pull origin master

helps if you cloned your own repo. What is you want to update your local copy of someone else repo? you do it like that

cd <your/local/cloned/repo/path/here>
git remote add upstream git://github.com/Abdur-rahmaanJ/honeybot.git
git fetch upstream
git pull upstream master

โšก Quickstart

โš ๏ธ moved to github.com/pyhoneybot/honeybot โš ๏ธ

  • specify your details in CONNECT.conf (already included)
[INFO]

server_url = chat.freenode.net
port = 6667
name = appinventormuBot
  • run main.py

๐Ÿ”Œ Todo Plugins

  • ๐Ÿ’ humour
  • ๐ŸŒจ๏ธ weather
  • โœ‰๏ธ mail
  • ๐ŸŽ›๏ธ maths
  • ๐Ÿ“ฅ pm when user online

โ˜‘ Allowing Plugins

in PLUGINS.conf, add the plugin to allow on a new line !

calc
username

๐Ÿ“ง Contact

Email

๐Ÿ–Š Credits

@arwinneil for opensource and madeinmoris badges

honeybot's People

Contributors

a-deeb avatar abdur-rahmaanj avatar ajimenezucla avatar angelogiacco avatar chibitofu avatar chrisp585 avatar colbsmcdolbs avatar dizzerin avatar duttasourav000 avatar edumello avatar german-corpaz avatar gicocarlo avatar glenntoms avatar iamnishant14 avatar ironpenguin4179 avatar macr0nerd avatar marceloyb avatar mboekhold avatar mi1acl avatar nickw409 avatar sseryani avatar tannerfry avatar towelietowel avatar vikramjeetd avatar vysor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

honeybot's Issues

HoneyGUI Config Editor

Is your feature request related to a problem? Please describe.
Add a config editor for the HoneyGUI

Describe the solution you'd like
Either multiple text fields or just a text editor window

Additional context
Major feature of HoneyGUI.

add send message to people in another channel plugin

given the bot is present in more than one channel, send message to another channel like

  • send general
    .send #channel hi all

-send but mention specific user
.send #channel .u riceabove .m how are you?

sends:
riceabove: how are you?

it can also check if user online first else says
user not online

ping timeout

Describe the bug
Bots does not respond to pong

To Reproduce
Steps to reproduce the behavior:
let the bot run for a while

Expected behavior
since we specifically check for pong, this should not happen

Plugins not executing in IRC

Describe the bug
Testing the bot on my personal IRC channel, I discovered that the bot would not detect plugins and typing things such as .test and .greet would return nothing despite appearing in the python terminal. Was testing for Issue #36.

To Reproduce
Steps to reproduce the behavior:

  1. Download and set up bot (username: hb_mn00)
  2. Change autoconnect channels
  3. Run main.py
  4. Test commands such as .test, .greet, and .btc

Expected behavior
The bot to return the plugins output, such as hoo or the current price of bitcoin.

Screenshots
image
image
Working on adding more screenshots

Desktop (please complete the following information):

  • OS: Fedora 29 Linux x86_64
  • IDE: Pycharm Community 2019.3
  • IRC: Hexchat, Freenode

Potential Solutions

  • I have been looking into a similar import structure as with pluginInfo.py using dynamic improt structure.

How to test plugins commands

thinking of another script sending a message to irc and sees if message from bot corresponds to expected message. feel free to discuss

Config via external file

Is your feature request related to a problem? Please describe.
security and parameters defined via main.py

Describe the solution you'd like
an external file callable via configparser

Describe alternatives you've considered
None

Additional context
None

Beautify console messages in form

Is your feature request related to a problem? Please describe.
logging is a mess

Describe the solution you'd like
beautify console messages - (not colours but in forms) - see pull method in bot

Better display of how the bot works in an IRC chat and set up for in IRC testing

Is your feature request related to a problem? Please describe.
I think the readme would benefit from a detailed explanation on how to set up the chatbot in an IRC.
Along with commands and examples of responses and inputs

Describe the solution you'd like
Perhaps add it to the wiki

Describe alternatives you've considered
Either adding a separate markdown file explaining the software
Maybe add screenshots too

Honey GUI Plugins

Is your feature request related to a problem? Please describe.
Add in the plugin select for HoneyGUI.

Describe the solution you'd like
Add in the plugin option and a select for it. Automatically update the PLUGINS.conf.

Additional context
A major feature of the Honey GUI.

add logging to file to bot

write whatever message the bot outputs to files in a log folder. name the file as .txt . use the logging module if possible

Honey GUI Base

Is your feature request related to a problem? Please describe.
Begin building the roots of the Honey GUI in either C++ or Python.

Describe the solution you'd like
We need the basic window as to start and stop the bot.

Additional context
Big part for the future of the bot.

HoneyGUI Status Page

Is your feature request related to a problem? Please describe.
Make a nicer status page for HoneyGUI as well as fix the TODOs

Describe the solution you'd like
Fix the TODOs and show if its running or not.

Additional context
A major feature of the Honey GUI.

add age plugin

.age

where birthday -> day-month-year

returns age

e.g. 20 years 5 months 1 day

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.