npm.io
2.0.5 • Published 10 years ago

vapor-friendslist

Licence
MIT
Version
2.0.5
Deps
0
Vulns
0
Weekly
0
Stars
2

NPM version

Vapor Friends List Plugin

Vapor plugin to manage friends list automatically.

Features

  • Accepts friend requests.
  • Removes the oldest friend if the friends list becomes full.
  • Sends welcome message.
  • Provides custom events for other plugins to listen to.
  • Admins are protected from being auto-removed

Installation

npm install vapor-friendslist
Usage
var friendslist = require('vapor-friendslist');

// Instantiate Vapor etc.

vapor.use(friendslist);
// or
vapor.use(friendslist, {
  limit: 100,
  welcomeMessage: 'Hello! Thanks for adding me.',
  welcomeMessageDelay: 3000
});
Configuration
limit (optional)

Friends list limit. Default value: 100

welcomeMessage (optional)

Welcome message text. Default value: undefined

welcomeMessageDelay (optional)

Welcome message delay in milliseconds. Default value: 3000 (3 seconds).

Events
message:*
  • message - A message string.

Standard Vapor message events to be used with logger.

readFile / writeFile

Standard Vapor file events - readFile / writeFile.

friendAccepted
  • steamID - user's SteamID64 as string

Friend request has been accepted.

friendRemoved
  • steamID - user's SteamID64 as string

Friend has been removed from friends list because the limit has been reached.

License

MIT. See LICENSE.