diff --git a/README.md b/README.md index 285f4e4..ae85ece 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -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 diff --git a/honeybot/PLUGINS.conf b/honeybot/PLUGINS.conf index 7d65734..6af3249 100644 --- a/honeybot/PLUGINS.conf +++ b/honeybot/PLUGINS.conf @@ -1,7 +1,7 @@ greet username joke - +dictionary maths calc caesar_cipher @@ -13,4 +13,4 @@ password_generator wikipedia weather mail -translate \ No newline at end of file +translate diff --git a/honeybot/main.py b/honeybot/main.py index b323897..88917ef 100644 --- a/honeybot/main.py +++ b/honeybot/main.py @@ -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 @@ -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') @@ -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 { @@ -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 diff --git a/honeybot/plugins/dictionary.py b/honeybot/plugins/dictionary.py index c11adcd..002cf73 100644 --- a/honeybot/plugins/dictionary.py +++ b/honeybot/plugins/dictionary.py @@ -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) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..4cc71c7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +PyDictionary==1.5.2 +requests==2.21.0 +wikipedia==1.4.0