Greetings all,

I'm sorry to have been away so long! I've been caught up in so much stuff. One of these things, evidently, was Pythabot - possibly my biggest public project yet.

Pythabot, put simply, is a base for IRC bots. It allows you to create a meaningless bot and then add on functionality as you go along through the use of "triggers" - text that the bot detects that can be used to trigger (hence the name) custom functions.

It is, of course, highly customizable: Bot name, nick, password (optional), IRC server, port #, admins (through the use of masks, to prevent imposters), and the owner (also through the use of masks).

Commands are added in a way that is completely separate from the main class file, which allows you to focus on the important parts only. These commands are essentially Python code. Because of this, you can configure your bot to do everything Python can do - shut down your computer, search the Internet, send a tweet, and more.

Commands are also given extensible arguments for which it can utilize to change their outcome. The name of the person saying the command, command arguments, channel it was said in, etc. are all passed to each individual command.

Pythabot even has a permission system. You can assign 3 permission groups to each command: owner, admin, and all. The names are kind of self explanatory.

I plan to add SSL support in the future to support any and all servers, as well as (maybe) color support.

If you are interested or wish to contribute to this project, I urge you to visit its project page on GitHub:

http://github.com/techboy6601/pythabot

Pythabot is completely open source. If you want to see an example of it in action, you can view admin.py in the templates folder on its GitHub page. If you'd like to utilize Pythabot, you can read the wiki - or, for diehard pros - the source code.

Thanks for reading, and happy hacking!

- Tech
Welcome back to Cemetech, Techboy! This certainly seems like an exciting project, and seems to be gradually getting more popular as a general theme of projects for those who are gaining proficiency in Python. Since there are quite a few projects like this out there, what do you feel sets yours apart? Other than SSL and color support, do you have anything in particular planned?
"Since there are quite a few projects like this out there, what do you feel sets yours apart?"

I think what sets Pythabot from the others is that it was made to be hacked but also easy to set up. If you look at the source you'll notice nearly every line was commented - this was deliberate to help newbie coders understand what is happening so they can add their own personal touch to it.

The OOP approach it takes to a situation like this also helps with the separation of code if the user so desires. They can reuse the main class file in multiple other projects without having to touch a single line of Pythabot code on their part.

And finally, I think what sets it apart from nearly everything else is the fact that it can be modified out of the box. Indeed, if you attempt to use Pythabot by itself you will simply have a stupid bot that sits on your channel. But using your imagination and the power of Python (which was chosen because of its simplicity) you can make it do anything. This makes it differ from the huge masses of linear bots which are made to serve one purpose and nothing extra.

" Other than SSL and color support, do you have anything in particular planned?"

I have, in fact, a list that seems to grow nearly every day! Here's some stuff pulled out from it:

Linker template - Attach it to a channel or person and it will echo out whatever is said to the channels/people (through PMs) attached to it at the other side

Regex command selection - for more freedom in commands (or indeed, the ability to make your command respond to anything at all)

Built-in standalone setup wizard? - to help the newbies

That's what I'm planning to add for the 4.0 release. In the meantime, I'm hard at work on my website which will serve as a kind of museum to have working examples of my other projects.
Just glancing at your documentation, I'm noticing some things that I found were important when developing MishaBot (which runs on top of a general-purpose IRC library).
For example: there's no facility for having multiple servers associated with a network, nor handling when the desired nickname is in use. As it is now, an in-use nick will cause the whole thing to silently hang. Nor do I see anything that handles things like connections timing out or being laggy, or just common IRC boilerplate like responding to server pings.

Anyway, you should submit this to PyPI if you want people to use it!
Tari wrote:
responding to server pings


This one is a biggie, and is REALLY important. Not responding to these causes your bot to be disconnected due to inactivity.

Quote:
Pythabot even has a permission system. You can assign 3 permission groups to each command: owner, admin, and all. The names are kind of self explanatory.


Will this be expanded to a more unix-y system? Maybe the flags could be list, execute from channel, and execute from msg.
Tari wrote:
there's no facility for having multiple servers associated with a network


I'm not sure I get what you're saying.

Tari wrote:
nor handling when the desired nickname is in use.


That will be added very soon.

Tari wrote:
or just common IRC boilerplate like responding to server pings.


Check the source again. Line 118. Wink

seana11 wrote:

Quote:
Pythabot even has a permission system. You can assign 3 permission groups to each command: owner, admin, and all. The names are kind of self explanatory.

Will this be expanded to a more unix-y system? Maybe the flags could be list, execute from channel, and execute from msg.


I'd rather keep this more simple, and I can't see any advantages from using a unix-y system instead of this one.
techboy6601 wrote:
Tari wrote:
there's no facility for having multiple servers associated with a network
I'm not sure I get what you're saying.
For example, EfNet is irc.efnet.net, irc.efnet.org, irc.nac.net, irc.prison.net, and so many more servers. It's a good idea to have your bot know a list of more than one server, so that it can round-robin if one fails or is unavailable.
Ha! I didn't even know that existed. It does have built-in netsplit support though. However, if this will ever get added, I think it will be in the far future (I am working on 3.8 as we speak)
techboy6601 wrote:
seana11 wrote:

Quote:
Pythabot even has a permission system. You can assign 3 permission groups to each command: owner, admin, and all. The names are kind of self explanatory.

Will this be expanded to a more unix-y system? Maybe the flags could be list, execute from channel, and execute from msg.


I'd rather keep this more simple, and I can't see any advantages from using a unix-y system instead of this one.


Sample use case:

bob wants to make a command to restart the server. He also needs to have some other people be able to restart it as well. So he codes his command and doesn't hard code any names into it. He then sets the owner to 'bob' and the group to 'admins'. He sets the permissions to r-mr-m---. This means that it will be listed for him and the other admins, but not users not belonging to these groups. He can create a groups file that dictates what users are in what groups, allowing easy changing of permissions without even touching the code (good practice). This would also be good to separate the process of authenticating with a password from the code (don't know if that's implemented or not). Using more sophisticated unix permissions allows for greater code compatibility and reusability because of less hard-coded constants.
This is easily achievable. Look at the source of admin.py in the templates folder. Any admin commands will be available to the owner, owner commands will be available only to owner, and all commands will be available to anyone and anything.

As for separating the code...that kind of ruins the point of a framework, eh? Wink

It is of course still possible. You could make it parse, say, an XML file containing names and put it into the respective lists.


Now, since Pythabot was made to help newbies who likely have never heard of Unix (or never worked with it before) I'd like to keep it as simple as possible and not overwhelm users with complex group files and permissions. If you really want to, you can fork the project and do it yourself Very Happy
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement