Coder Social home page Coder Social logo

nairobi-bot's Introduction

Nairobilug IRC bot

Nairobilug IRC bot in haskell taking advantage of discrete events (some will call it FRP) in haskell.

Build Status Hackage

Usage

  • seen @seen <nick>
  • reputation
    • Check reputation @rep <nick>
    • Add reputation +1 <nick>
    • Subtract reputation -1 <nick>
  • 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
Maybe later if need be
  • google/duckduckgo @search <search query>
  • wikipedia @wiki <search query>

Reasons

  • 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.

Tests

I haven't yet written tests for it but they are coming.

Main deps

Deploying

Build and run the nairobi-bot executable like any other binary. Preferably using stack:

  • stack build to compile but not add it to path
  • stack 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 &
  1. nohup means: Do not terminate this process even when the stty is cut off.
  2. /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output).

  3. 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
  4. & at the end means: run this command as a background task.

License

GPL-3.0 See LICENSE file for complete license.

Other/RTFM

See the Wiki

nairobi-bot's People

Contributors

poppingtonic avatar urbanslug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nairobi-bot's Issues

Reputation is broken.

The reputation part of the bot doesn't add or subtruct reputation.

Have better UX by using +1 and -1 for reputation.

Update README accordingly.

Dockerize

Create a docker image for nairobi-bot.

Automated meetup notifications?

A nice enhancement to have would be automated meetup notifications.

Our meetups (@nairobilug) - every 1st Saturday of the month - are always announced late. If we could automate notifications* every ~30 days, I think turnout would be better.

* mailing list (email), twitter and irc. ๐Ÿ‘

Introduce some form of persistence.

The bot should save state, user accounts, seen and reputation somewhere it can read from so that the bot going down or being recompiled/updated doesn't mean loss of data.

Escape input strings.

Escape input strings, currently we don't escape input strings at all this affects RoomBots such as @echo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.