Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/augustt198/skypebot


https://github.com/augustt198/skypebot

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# skypebot

A bot framework for Skype that allows for easy command registration.

## Usage

The bot can be started by executing `skype.rb`

```sh
$ ruby skypebot.rb [options]
```

Command options:

```
Usage: ruby skypebot.rb [options]
-i, --id ID Select chat by ID
-t, --topic TOPIC Select chat by topic
-m, --members Select a chat containing member(s)
-s, --skip Begin at the most recent message
```

## Commands & Listeners
This SkypeBot framework provides a DSL for easily creating commands and listeners.

```ruby
command 'hello', help: 'Get a greeting' do |cmd|
if cmd.has_flag? 'casual'
cmd.reply "Hi #{cmd.user}"
else
cmd.reply "Greetings, #{cmd.user}."
end
end
```

Adding listeners is also supported:
```ruby
listen match: /(skypebot)/i do |msg|
msg.reply 'I heard my name!'
end
```
If the `match:` option is not present, all messages will be listened to.