jcowgill / jircd

JIRC Server
Apache License 2.0
3 stars 0 forks source link

Adding new non IRC commands #9

Open RobertEcker opened 9 years ago

RobertEcker commented 9 years ago

1) Non-standard IRC commands: Is there a way to add non-IRC commands, e.g., DICE:

Input: /DICE Output: * Nick dices 4

2) The main problem in my consideration is: How can you distinguish between "/DICE" and "/ME dices 4" The output should look differently than, e.g., "/ME" else this command is nonsense (you can cheat).

3) But it depends on the client. Therefore, ... Is it possible, that common IRC clients understand such a command (without changing the client's code)? Or is there another way?

So my main question is: Is adding a new non-IRC command possible without changing the any client code and looking different from, e.g., "/ME"?!

jcowgill commented 9 years ago

No I don't think it's possible to make it appear differently without changing any client code. I think the best way to do what you want (at least I think so) is to create an IRC bot. You have it join the channel you're doing this on and when anyone says !dice (or something similar), the bot will reply with the dice roll. You can't cheat when you do it this way and as a bonus it should work on any IRC server.

RobertEcker commented 9 years ago

tnx for your anser

is !dice == /dice? if the command should not displayed in the current channel, i have to write the message directly to the bot by using, e.g., "/botname dice", shouldnt i?

maybe another way would be this: server has to replace all "/dice" with "/botname dice", so this message is sent to the bot ...

but is it also possible, that a) the jircd server perform this command and answers with, e.g., "* jircd: user dices 4"? (so it is obviously different to "user dices 4") b) without having an explicit user(bot) called "jircd"?

jcowgill commented 9 years ago

is !dice == /dice?

No I did mean !dice, you type it into the channel and the bot responds.

if the command should not displayed in the current channel, i have to write the message directly to the bot by using, e.g., "/botname dice", shouldnt i?

If you really don't want the command displayed, yes you would need something like "/msg botname dice" I don't see the point in preventing this though since everyone in the channel will immediately know you sent that command from the response the bot provides.

maybe another way would be this: server has to replace all "/dice" with "/botname dice", so this message is sent to the bot ...

Yep you could do that (you'll need to write your own command in Java though)

but is it also possible, that a) the jircd server perform this command and answers with, e.g., "* jircd: user dices 4"? (so it is obviously different to "user dices 4") b) without having an explicit user(bot) called "jircd"?

Actually I didn't think of this but yes you could do it that way as well, but I think this would only work if an entire server was devoted to dicing. What if the user has joined multiple channels, where does the message go?

RobertEcker commented 9 years ago

I think it is message overload to see both lines (!dice and the results) ... that's why - similar to other commands (e.g., JOIN) - you should see IMHO only the result of the message.

What if the user has joined multiple channels, where does the message go?

Independent of clients, i think you have to add another paramter like: "/dice <#channel>"

if the client is adapted, it should work without this parameter