Bot Question reddit / irc ---------------------------------------------------------------------- Linuxthekid · 2015-07-04 13:46 Is there any way for a bot to recognize /r/ and respond with a complete reddit link? ---------------------------------------------------------------------- Jonno_FTW · 2015-07-04 14:37 Yes, it's called a regex and should be easy in any modern language. ---------------------------------------------------------------------- ne7split · 2015-07-04 18:20 In Perl: #!/usr/bin/perl my $msg = "Hello from /r/irc"; # check $msg for something that looks like a subreddit # e.g. /r/irc, r/irc my ($sub) = $msg =~ /(\/?r\/[a-z]+)/i; # if it doesn't start with a /, prepend to string. if ($sub !~ /^\//) { $sub = '/'.$sub; } # check $sub isn't just a slash if ($sub ne '/') { print "https://reddit.com$sub"; } ---------------------------------------------------------------------- Linuxthekid · 2015-07-05 04:41 Is there a premade bot that does something similar that I can modify? ---------------------------------------------------------------------- ne7split · 2015-07-05 13:30 What system do you want to run it on? Which client do you use?