IRC bot standards - Printable Version +- Forums - Open Redstone Engineers (https://forum.openredstone.org) +-- Forum: Off-Topic (https://forum.openredstone.org/forum-4.html) +--- Forum: Programming (https://forum.openredstone.org/forum-8.html) +--- Thread: IRC bot standards (/thread-11967.html) |
IRC bot standards - qwerasd205 - 03-20-2017 This is a brief thread to read if you're thinking of making an IRC bot. To get started follow the rules laid out in https://forum.openredstone.org/rules.php -- specifically:
Now the standards: Help dialog:
RE: IRC bot standards - Nickster258 - 03-21-2017 Well, the rules for bots will only really be constricted to "Don't let your bot become a nuisance". These are more of recommendations, which should definitely be used. You suggested timeouts for web stuff but a timeout for literally anything would be good so people don't spam your bot (Our IRC setup throttles spammed requests so if you send TONS of requests the bot could get held up, kinda like how varBot was held up when I spammed it) . I always did regex and forced alphanumeric standards on my inputs. RE: IRC bot standards - Apuly - 03-21-2017 I will now proceed to develop a bot that will break all of these rules RE: IRC bot standards - Nickster258 - 03-21-2017 Well, these are more of recommendations but yea RE: IRC bot standards - Apuly - 03-21-2017 Eh close enough RE: IRC bot standards - jxu - 03-23-2017 jxubot transcends standards !lottery !lottery !lottery !lottery !lottery !lottery RE: IRC bot standards - Apuly - 03-23-2017 shit you've beaten me by like a couple of years I guess Idunnow RE: IRC bot standards - slugdude - 03-26-2017 I'm still gonna make a shell bot when I get the chance in the summer holidays. RE: IRC bot standards - LambdaPI - 03-26-2017 Lets all exploit it Yea slug thats a great idea. RE: IRC bot standards - Apuly - 03-27-2017 Protip: don't try to auth shit over IRC based on username. So easy to break it's almost sad. RE: IRC bot standards - tokumei - 06-09-2017 *shameless bump* ^ Look into IRC user/host masking, it's a great tool that IRC server ops and mods use to manage bans and other things. Here's a quick rundown: With every message that a user sends, its full identity is sent. This is the part at the beginning of the message, and it looks like this: :nonemu!adam@shinobi.nonemu.ninja It consists of 3 parts: - The "nickname," which is after a : . This is what most clients display as your name when you join a channel and is guaranteed by the server to be unique at any given point in time. However, it may change during a session. - The "username," which is after a ! . This is another string provided by the user when it sends USER at the beginning of initialization. Some bots won't let you change it easily - mine uses the username of the system user that ran the command. This can _not_ change after you have connected, but is not guaranteed to be unique between simultaneous users. - The "hostname," which is after a @ . This is a string assigned to the user by the server which is based on the IP address / reverse DNS hostname of the machine connecting to the server. Some servers attempt to conceal the hostnames of their clients by "host masking," which is an unrelated term that just means hashing or otherwise cryptographically obfuscating their hostname and sending that string in place of their actual hostname. Either way, it functions as a reliable method of identifying users, as it is guaranteed to be consistent as long as the user does not change their originating IP. How to apply this? The IRC protocol allows you to place wildcards in the mask, like *!*@98.25.36.192 will match with all users whose hostname is 98.25.36.192 (ie, that is where they connected from). You can also combine wildcards with text, for example: *!*@*.cn will match hostnames ending in .cn (Chinese TLD). This is a fantastic way to identify users, at least for whitelisting, because it's very difficult for someone to spoof your IP unless you give them access to a machine with that IP. If you want to see an implementation, here's mine for Samurai. I substituted regular expression phrases for the wildcards so I could use Java's built-in regex utilities. It works well for me; though I could probably find a few bugs like unescaped characters now. |