tjcsl / cslbot

An easily extensible, modular irc bot.
GNU General Public License v2.0
15 stars 16 forks source link

Divorce cslbot from Linux-specific commands #678

Open sapphire-arches opened 10 years ago

sapphire-arches commented 10 years ago

Commands that currently rely on such trickery [ ] bc [ ] ddate [ ] eix [ ] errno [ ] fortune [ ] gcc [ ] ping [ ] pull [ ] version [ ] wtf

Some of these obviously can't be written platform-agnosticly (for things like eix, errno and gcc it makes no sense) but I think a few of these should definitely be doable.

At the very least we can provide nice messages when things fail

an-empty-string commented 10 years ago

pull - not linux-specific, this could theoretically use msysgit (I think) version - same case wtf - we're going to need to create a database of acronyms ping - probably platform-specific command (if posix then ping -c1, else ping -whateverthethingisinwindows) gcc, eix, errno - like you said bc - we can write a simple expression parser for this one

sckasturi commented 10 years ago

Or do what weechat does and require it be run in cygwin :P That way !bc and a couple others will still work.

-----

On Wed, Jan 15, 2014 at 10:33 PM, fwilson42 notifications@github.comwrote:

pull - not linux-specific, this could theoretically use msysgit (I think) version - same case wtf - we're going to need to create a database of acronyms ping - probably platform-specific command (if posix then ping -c1, else ping -whateverthethingisinwindows) gcc, eix, errno - like you said bc - we can write a simple expression parser for this one

— Reply to this email directly or view it on GitHubhttps://github.com/tjcsl/cslbot/issues/678#issuecomment-32439700 .

sapphire-arches commented 10 years ago

@TechFilmer That is a terrible terrible idea - most of the bot is OK outside of POSIX environments, with the exception of these few commands.

pefoley2 commented 10 years ago

There is no way in hell that cygwin should be a requirement

sckasturi commented 10 years ago

Alias !math to !wolf perhaps? That'll fix !bc's issue.

pefoley2 commented 10 years ago

that's really tangential to this issue.

an-empty-string commented 10 years ago

How about using eval without any functions defined?

sdamashek commented 10 years ago

We would have to be REALLY careful about that, but if it's implemented safely and securely that would work. Fast too compared to wolfram alpha.

pefoley2 commented 10 years ago

I took a look at doing that safely (it didn't work), but i'm not sure that this is enough of an issue to justify running eval on user input.

sckasturi commented 10 years ago

Maybe if it doesn't return an int we don't send the output?

-----

On Thu, Mar 20, 2014 at 10:10 PM, Peter Foley notifications@github.comwrote:

I took a look at doing that safely (it didn't work), but i'm not sure that this is enough of an issue to justify running eval on user input.

— Reply to this email directly or view it on GitHubhttps://github.com/tjcsl/cslbot/issues/678#issuecomment-38242542 .

pefoley2 commented 10 years ago

do you have the slightest clue what eval does?

an-empty-string commented 10 years ago

That's even worse... Supybot has some code to do this sort of thing -- let's look at that.