Nairobilug IRC bot in haskell taking advantage of discrete events (some will call it FRP) in haskell.
- seen
@seen <nick>
- reputation
- Check reputation
@rep <nick>
- Add reputation
+1 <nick>
- Subtract reputation
-1 <nick>
- Check reputation
- last fm
Setting a new username for your nick replaces the older one.
@np set <username>
to associate a last.fm username with your nick.@np <last.fm username>
If you don't want to set your last fm username.@np
If your IRC nick is your last.fm username or if you have set your last.fm username.
- factoid
@factoid <name> <message>
- define
@define <word/phrase>
- echo
@echo <sentence you want to echo>
- ping
@ping
- gif
@gif <search term>
- wolfram alpha
@wa <search query>
- URLs Automatically fetches page titles from URLs.
- Help
@help
— there are too many commands to paste the help in a channel so we give the user a URL to the wiki: https://github.com/nairobilug/nairobi-bot/wiki#usage
- google/duckduckgo
@search <search query>
- wikipedia
@wiki <search query>
- Main reason is because I can ;D.
- I want to play with the auto library and discrete events in haskell.
- I want to write a bot without going through a bot building framework.
- Much thanks to Justin Lee for creating the auto library.
I haven't yet written tests for it but they are coming.
Build and run the nairobi-bot executable like any other binary. Preferably using stack:
stack build
to compile but not add it to pathstack install
to add nairbibot-exe to path./.stack-work/install/x86_64-linux/lts-3.15/7.10.2/bin/nairobi-bot-exe
In production use the following answer from stackoverflow to run your executable.
nohup .stack-work/install/x86_64-linux/lts-3.15/7.10.2/bin/nairobi-bot-exe > /dev/null 2>&1 &
- nohup means: Do not terminate this process even when the stty is cut off.
-
/dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output).
- 2>&1 means: stderr also goes to the stdout (which is already redirected to /dev/null). You may replace &1 with a file path to keep a log of errors, e.g.: 2>/tmp/myLog
- & at the end means: run this command as a background task.
GPL-3.0 See LICENSE file for complete license.
See the Wiki