Coder Social home page Coder Social logo

gobot's Introduction

Build Status Coverage Status Code Climate

gobot

My first Go program

An IRC bot is my "hello world" for network applications. I have a few in Python and one in newLISP.

Spec

The bot only supports connecting to a single server and channel.

The bot is started with three command line arguments:

  • server the IRC server to connect to
  • channel the channel to join
  • nick the nickname to use

The bot understands one command: msg.

The msg command takes two arguments:

  • the recipient of the message
  • the content (body) of the message

There are public and private messages. A public message is sent by calling the msg command in a channel. A private message is sent by calling the msg command in a private chat with the bot.

Messages have the attributes

  • sender
  • timestamp
  • private
  • body

When a message to a new recipient is sent, the bot creates a mailbox for that recipient. The mailbox is added to the repository of mailboxes.

The messages are stored until a user with the given recipient nick joins the channel. Private messages are sent in a private chat, public ones in the channel. They are sent in the format <timestamp> <sender> <body>. After a message is sent, it is removed from the recipients mailbox. Empty mailboxes are removed from the repository.

Messages are not sent immediately if the recipient is currently present in the channel.

There is a maximum number of messages per mailbox. When that limit is reached, no more messages to that recipient are accepted and the bot responds with an error message.

There is a maximum number of mailboxes. When that limit is reached, no more messages to new recipients are accepted and the bot responds with an error message.

gobot's People

Contributors

haikoschol avatar

Watchers

 avatar  avatar  avatar

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.