Skip to content

This npm module serves you a Promise of a random FML

Notifications You must be signed in to change notification settings

lebbe/random_fml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random FML

This module serves you a Promise of a random FML.

Usage:

require('random_fml')().then(fml => console.log(fml))

Output:

Today, my girlfriend received a scam email about her great uncle dying and leaving her money. She not only believed it, but she also used my credit card details for it. FML

The promise thus resolves to a string that is the very FML you are looking for.

Example irc-bot

Here is how you could use random_fml to set up a simple irc-bot that responds to "?fml".

const fml = require('random_fml')
const irc = require('irc')

const client = new irc.Client('irc.some_irc_server.net', 'botnick', {
	channels: ['#some_channel']
})
.addListener('message', function (from, to, message) {
	if(/^\?fml/.test(message)) {
		fml().then(fml => client.say(to, fml))
		return
	}
})

About

This npm module serves you a Promise of a random FML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published