Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a simple chatbot for our IRC channel #62

Closed
wants to merge 5 commits into from

Conversation

mrhmouse
Copy link
Contributor

@mrhmouse mrhmouse commented Nov 8, 2013

Redbot is a simple chatbot for IRC. It isn't the best chatbot in the world, but it's a start.

To use Redbot, you'll need CoffeeScript.

#!/usr/bin/env coffee

path = require 'path'
Bot = require path.join __dirname, '..', 'include', 'redbot', 'bot.coffee'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to take the path relative to RED_SPIDER_ROOT for more robustness and less wheel-reinventing.

Even better would be to have setup.py (optionally?) copy the contents of include/redbot to lib/redbot (because it's a runtime dependency) and then have rsshell add lib to whatever environment variable Coffeescript uses to find libraries, so you can just require path.join redbot, bot.coffee here.

@jgonggrijp
Copy link
Member

Pretty neat, but some more questions:

  • What about installation? (I made the comment about the submodule contents, you also have to consider what needs to be done if people want to install src/redbot.coffee).
  • What about documentation?
  • How would you suggest testing it?

@mrhmouse
Copy link
Contributor Author

mrhmouse commented Nov 8, 2013

To test it, you should just run it and see if a bot appears in #redspider. I still need to add documentation.

@WesleyAC
Copy link
Contributor

WesleyAC commented Nov 9, 2013

Hey,
Sounds cool, but I haven't tested it yet.
BTW, since it doesn't look like you have much (if anything) in terms of commands yet, here's my 2 cents about commands:

Each command should be in a file (probably in /lib/redbot/ or /other/redbot) that is executed when !<filename> is said in irc. This would make multiple people working with multiple commands easier, as well as keeping the bot source code clean. <shamelessselfpromotion>I'm thinking something like https://github.com/WesleyAC/pyrcbot. </shamelessselfpromotion>

@mrhmouse
Copy link
Contributor Author

mrhmouse commented Nov 9, 2013

Actually it doesn't receive commands, it just spouts nonsense.

I have a bot that works similarly to what you're describing, though, with
the ability to load functionality on the fly. If you're interested in that
sort of bot, I could add it (or you could add yours) :)
On Nov 9, 2013 1:28 PM, "Wesley Aptekar-Cassels" [email protected]
wrote:

Hey,
Sounds cool, but I haven't tested it yet.
BTW, since it doesn't look like you have much (if anything) in terms of
commands yet, here's my 2 cents about commands:

Each command should be in a file (probably in /lib/redbot/ or
/other/redbot) that is executed when ! is said in irc. This
would make multiple people working with multiple commands easier, as well
as keeping the bot source code clean. I'm
thinking something like https://github.com/WesleyAC/pyrcbot.


Reply to this email directly or view it on GitHubhttps://github.com//pull/62#issuecomment-28133475
.

@lramati
Copy link

lramati commented Nov 10, 2013

I question the addition of multiple irc bots given that personally I
envisioned this as a more offline project. That said, I now have more
incentive to finally write that fake irc server that let's you use an irc
bot offline. Wonder if there's a good way to work it into rsshell...

I'll post a new issue with some ideas related to making the integration work

@WesleyAC
Copy link
Contributor

@mrhmouse Could you put the source for that somewhere? I'd love to take a look at that.
@firerogue I wasn't suggesting that you use mine, just saying that I think that whatever bot we have should a modular system like that. I like the psudocommands idea, but I'll probably say a little about that in the commants on #65.

@mrhmouse
Copy link
Contributor Author

@WesleyAC Sorry about the delay. Here you go.

@WesleyAC
Copy link
Contributor

@mrhmouse Thanks.

# add more of such steps if that's feasible and no build system is available

def install_submodules ( ):
call(["git", "submodule", "update"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Windows this will most likely throw a WindowsError, as git might not be in %path%.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, if git is installed it is in the PATH. Or at least if the user installed MsysGit, but probably also in case of the other ports (because git is supposed to be used from the command line). The real problem is that the user might not have git installed. But that can be dealt with by making the redbot install optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also package some git Python module with RSP and use that instead. I don't have a preference; what do you suggest, @jgonggrijp?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. What do you mean by "package some git Python module with RSP"?

Before knowing what you mean, I'm inclined to suggest that you just make the install optional. But once I know what you mean I might change my opinion. ;-)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

packaging a Python git module sounds silly. but correct me if i'm wrong, doesnt downloading the zip (the only way i can think of right now to download the project without using git) download the submodule as well? and same for downloading the project via git. doesnt it automatically download submodules too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps package the git module with creto? See #42.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, downloading the repo (zip or git) does not automatically also download the submodule.

@WesleyAC: would packaging a git module (whatever that means) with git-creto not be completely backwards? Creto only makes sense if you're already using git.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "packaging a git module" I mean including something like GitPython in the project so that we can interact with the Git repository.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitPython looks useful. But it also seems that including it with the project would just move the problem, since it depends on GitDB. Ultimately, I think we always end up having the choice between declaring something an external dependency (and potentially making the installation of some apps dependent on it) and bloating our project with tons of included dependencies.

@mrhmouse
Copy link
Contributor Author

There doesn't seem to be much push for an IRC bot in the Red Spider Project, and our IRC channel is too dead for it to gather much chat data.

Closing this.

@mrhmouse mrhmouse closed this Nov 15, 2013
@mrhmouse mrhmouse deleted the redbot branch November 15, 2013 19:25
@jgonggrijp
Copy link
Member

Aww. :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants