Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vutran/lctv-bot
https://github.com/vutran/lctv-bot
bot lctv livecoding xmpp
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/vutran/lctv-bot
- Owner: vutran
- License: mit
- Created: 2015-12-18T09:56:07.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-03T20:38:51.000Z (about 9 years ago)
- Last Synced: 2024-05-02T05:43:29.029Z (9 months ago)
- Topics: bot, lctv, livecoding, xmpp
- Language: JavaScript
- Size: 102 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Create a new Client
```javascript
const client = new Client({
username: 'this is your LCTV username',
password: 'this is your LCTV password'
})
```# API
## Client
### Methods
`Client.connect()`
`Client.send(stanza, debug)`
`Client.join(channel)`
`Client.ping()`
`Client.say(message)`
### Events
`online`
`connect`
`disconnect`
`reconnect`
`error`
`stanza`
`lctv:cmd`
`lctv:cmd:admin`
`lctv:presence`
`lctv:message`
`lctv:iq`
`lctv:channel:join`
When a user joins the channel.
`lctv:mentions:all`
When any user is mentioned.
`lctv:mentions:self`
When someone mentions your username.
`lctv:follower:error`
`lctv:follower:new`
`lctv:follower:run`
`lctv:timer:tick`
## Bot
```javascript
const bot = new Bot({
client: client,
channel: 'the name of the channel you wish to join',
mentions: 'the username you wish to listen to for mentions',
admins: 'the username that can execute admin commands',
plugins: [] // a list of plugins to load
})```
### Methods
`getName()`
Retrieves the name of the bot (used for desktop notifications).
`start()`
Starts the bot.
`join()`
Joins the channel.
`on(event, handler)`
Listen to an event, and runs the handler when emitted.
`createStore(name)`
Creates a new storage device
`retrieveUser(username, options, callback)`
Retrieve a new User instance (loads from the user store if already exists)
`retrieveUserFromStanza(stanza, callback)`
Retrieve a User instance from a stanza.
`saveUser(user)`
Saves the user to the user store.
`setContent(key, value)`
Sets the value for the given key.
`getMentionsFromValue(value)`
Retrieves a list of mentions.
`getUsers()`
Retrieves a list of online users.
**Content Keys**
|Key|Description|
|---|---|
|`botName`|The name of the bot. (Default: LCTV Bot)|`getContent(key)`
Retrieves the value of the given key.
`createCommand(cmd, description, handler)`
Creates a new command.
`getCommands()`
Retrieve existing commands.
`speak(message)`
Speaks the message to the room (voice).
`say(mesasge)`
Prints the message to the room (text).
`notify(message)`
Displays a desktop notification.