commit a115fcfb9db5eabb3e049f7df02ae13dfd247713
parent 9a845840fcd8688495db20d2454274982b170e99
Author: noodle <noodle@pastanoggin.com>
Date: Sat, 14 Jun 2025 21:05:20 +0300
add a man page! this boy has become a man!
Diffstat:
M | Makefile | | | 4 | ++++ |
A | matabot.8 | | | 152 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 files changed, 156 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,4 +1,5 @@
PREFIX = /usr/local
+MANDIR = ${PREFIX}/man
SHAREDIR = ${PREFIX}/share
RCDIR = /etc/rc.d
@@ -13,15 +14,18 @@ clean:
install: mata_bot.pl matabot.8 rc_script
install -d ${DISTDIR}${PREFIX}/sbin
install -d ${DISTDIR}${PREFIX}/share
+ install -d ${DISTDIR}${MANDIR}/man8
install -d ${DISTDIR}${SHAREDIR}/matabot
install -d ${DISTDIR}${RCDIR}
install mata_bot.pl ${DESTDIR}${PREFIX}/sbin/matabot
install quotes ${DESTDIR}${SHAREDIR}/matabot/quotes
install ball ${DESTDIR}${SHAREDIR}/matabot/ball
+ install -m 644 matabot.8 ${DESTDIR}${MANDIR}/man8/matabot.8
install rc_script ${DESTDIR}${RCDIR}/matabot
uninstall:
rm -f ${DESTDIR}${PREFIX}/sbin/matabot
+ rm -f ${DESTDIR}${MANDIR}/man8/matabot.8
rm -f ${DESTDIR}${SHAREDIR}/ball
rm -f ${DESTDIR}${SHAREDIR}/quotes
rm -f ${DESTDIR}${RCDIR}/matabot
diff --git a/matabot.8 b/matabot.8
@@ -0,0 +1,152 @@
+.Dd $Mdocdate: June 11 2025 $
+.Dt MATABOT 8
+.Os
+.
+.Sh NAME
+.Nm matabot
+.Nd seek and destroy technomage
+.
+.Sh SYNOPSIS
+.Nm matabot
+.Op Fl tl
+.Op Fl b Ar path
+.Op Fl h Ar host
+.Op Fl j Ar join
+.Op Fl p Ar port
+.Op Fl h Ar path
+.Op Fl q Ar port
+.
+.Sh DESCRIPTION
+.Nm
+starts an IRC bot nicknamed
+.Sq mata_bot
+and joins the channel
+.Sq #testmatabot
+on localhost (port 6667) with with TLS turned off by default. It's typically
+started as a daemon via an rc.d script.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl t
+Turn on TLS.
+.It Fl b Ar path
+load the 8ball file from
+.Ar path
+.Po default: Pa $PREFIX/share/matabot/ball Pc Ns .
+.It Fl h Ar host
+connect to
+.Ar host
+(default: localhost).
+.It Fl j Ar join
+join
+.Ar channel
+(default: #testmatabot).
+.It Fl l
+Turn on logging to stdout.
+.It Fl p Ar port
+connect to
+.Ar port
+(default: 6667).
+.It Fl q Ar path
+load the quotes file from
+.Ar path
+.Po default: Pa $PREFIX/share/matabot/quotes Pc Ns .
+.El
+.Sh COMMANDS
+Bot can do some tricks:
+.Bl -tag -width Ds
+.It *mata_bot*
+Says something! This boy talks back!?
+.It mata_bot[:, ] What doth life? or mata_bot, What doth life?
+Answers your burning questions... (can't hear you if you don't
+.Sq \&?
+him).
+.It http://what.ever/idk#lol or https://what.ever/idk#lol
+Reads the website title or content-type for you.
+.It *watch?=SOMEID*
+Reads out the youtube video title for you (make sure that the char after end of
+.Sq SOMEID
+is outside the range of valid characters for youtube video ID's okay?).
+.It mata_bot[:, ]*${number1}d${number2}*
+Rolls some ${number1} of ${number2}-sided dice. He's a dungeon master too!!
+.It mata_bot[:, ]*good*(bot|boy|girl)*
+Thank your future master.
+.El
+.Sh ENVIRONMENT
+.Bl -tag -width Ds
+.It Ev PREFIX
+used to find the ball and quotes files under
+.Pa /share/matabot/
+.Po default: Pa /usr/local/ Pc Ns .
+.Sh FILES
+.Bl -tag -width Ds
+.It Pa /etc/rc.d/matabot
+OpenBSD rc script for running matabot as a service.
+.It Pa /usr/local/share/matabot/ball
+8ball answers file. has 10 answers for positive, negative, and ambigious each
+keep the ratio when adding new lines as the answer is chosen randomly from the
+file.
+.It Pa /usr/local/share/matabot/quotes
+random quotes mostly from the https://analognowhere.com comic.
+.El
+.
+.Sh EXIT STATUS
+.Ex
+.
+.Sh EXAMPLES
+Typical invocation
+.Po use these flags in your Pa /etc/rc.conf.local Pc Ns :
+.Pp
+.Dl $ matabot -tlh irc.server.tld -j #analognowhere -p 6697
+.Pp
+Test on a local ircd (without TLS):
+.Pp
+.Dl $ matabot -l
+.
+.Sh SEE ALSO
+.Xr perl 1 ,
+.Xr IO::Socket 3p
+.
+.Sh STANDARDS
+.Bl -item
+.It
+.Rs
+.%A Jack Allnutt
+.%A Daniel Oaks
+.%A Val Lorentz
+.%T Modern IRC Client Protocol
+.%I ircdocs
+.%U https://modern.ircdocs.horse/index.html
+.Re
+.It
+.Rs
+.%A J. Oikarinen
+.%A D. Reed
+.%T Internet Relay Chat Protocol
+.%I IETF
+.%R RFC 1459
+.%U https://tools.ietf.org/html/rfc1459
+.%D May 1993
+.Re
+.It
+.Rs
+.%A C. Kalt
+.%T Internet Relay Chat: Client Protocol
+.%I IETF
+.%R RFC 2812
+.%U https://tools.ietf.org/html/rfc2812
+.%D April 2000
+.Re
+.El
+.
+.Sh AUTHORS
+.An noodle Aq Mt noodle@pastanoggin.com Ns .
+.
+.Sh CAVEATS
+Noodle (noodle) is the only person in chat who can give direct commands to mata_bot (it's hard-coded. sorry).
+.Sh BUGS
+The bot doesn't have the ability te re-connect on network loss yet. You can
+.Sq rcctl restart matabot
+for now.
+.Pp
+The bot cannot detach from terminal yet to become a daemon. daemon-izing is handled in the rc service script.