Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdur-rahmaanJ committed Apr 4, 2019
2 parents 74ea2a7 + 3eeb0cd commit e59e848
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![first-timers-only](https://img.shields.io/badge/first--timers--only-friendly-blue.svg?style=flat-square)](https://www.firsttimersonly.com/)
![Open Source Love](https://img.shields.io/badge/Open%20Source-%E2%9D%A4-pink.svg)
![Open Source Love](https://img.shields.io/badge/chat%20on-discord-green.svg)
![MadeinMoris](https://img.shields.io/badge/Made%20in-Moris-green.svg)

# 🍯 honeybot py
Expand All @@ -13,7 +14,7 @@ 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 slack page!
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.

Expand All @@ -34,6 +35,10 @@ get issues delivered in your inbox.
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](https://github.com/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.
## ✂ Current Features
* 🍬 OOP architecture
* 🛰️ keyword parameters
Expand Down
4 changes: 2 additions & 2 deletions honeybot/PLUGINS.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
greet
username
joke

dictionary
maths
calc
caesar_cipher
Expand All @@ -13,4 +13,4 @@ password_generator
wikipedia
weather
mail
translate
translate
8 changes: 4 additions & 4 deletions honeybot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self,
owners=['appinventorMu', 'appinv'],
password='',
friends=['haruno', 'keiserr', 'loganaden'],
autojoin_channels=['##bottestingmu']
autojoin_channels=['#ltch']
):
self.server_url = server_url
self.port = port
Expand Down Expand Up @@ -115,7 +115,7 @@ def join(self, channel):
def load_plugins(self, list_to_add):
print("\033[0;36mLoading plugins...\033[0;0m")


to_load = []
with open('PLUGINS.conf', 'r') as f:
to_load = f.read().split('\n')
Expand All @@ -130,7 +130,7 @@ def load_plugins(self, list_to_add):

self.plugins = list_to_add
print("\033[0;32mLoaded plugins...\033[0;0m")


def methods(self):
return {
Expand Down Expand Up @@ -225,7 +225,7 @@ def stay_alive(self, incoming):
if 'ping' in incoming.lower():
part = incoming.split(':')
if self.domain in part[1]:
self.send(self.pong_return())
self.send(self.pong_return() + ":{0}".format(part[1]))
print('''
***** message *****
ping detected from
Expand Down
19 changes: 7 additions & 12 deletions honeybot/plugins/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,20 @@
returns meaning of the word specified
"""

import PyDictionary

from PyDictionary import PyDictionary

class Plugin:
def __init__(self):
pass

def __dictionary(self, word):
return PyDictionary().meaning(word).get('Noun')

def run(self, incoming, methods, info):
try:
# if '!~' in info['prefix']:
# print(info)
msgs = info['args'][1:][0].split()
if info['command'] == 'PRIVMSG':
if len(msgs) > 1:
if msgs[0] == '.dictionary':
word = msgs[1]
methods['send'](info['address'], Plugin.__dictionary(self, word))

if info['command'] == 'PRIVMSG' and msgs[0] == '.dictionary':
dict = PyDictionary()
word = str(msgs[1])
defin = dict.meaning(word)['Noun']
methods['send'](info['address'], '{}'.format(defin))
except Exception as e:
print('woops plug', e)
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PyDictionary==1.5.2
requests==2.21.0
wikipedia==1.4.0

0 comments on commit e59e848

Please sign in to comment.