-
-
09 Aug 2009 19:32:40 UTC
- Distribution: IM-Engine-Plugin-State
- Module version: 0.01
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (430 / 5 / 11)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Perl: v5.8.1
- Activity
24 month- Tools
- Download (22.47KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors-
Shawn M Moore, C
- Dependencies
- IM::Engine
- Moose
- MooseX::ABC
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
IM::Engine::Plugin::State - Keep track of some state for each user
SYNOPSIS
IM::Engine->new( interface => { ... incoming_callback => sub { my $incoming = shift; my $user = $incoming->sender; my $last_time = $user->get_state('last_time'); my $now = time; $user->set_state(last_time => $now); if ($last_time) { return $incoming->reply("You last IMed me " . ($now - $last_time) . "s ago."); } else { return $incoming->reply("Hi, IM me again!"); } }, }, plugins => ['State::InMemory'], )->run;
DESCRIPTION
This module lets you store some state for each user. Right now the only backend is IM::Engine::Plugin::State::InMemory which seriously limits usability. But more will come. I just want something with a useful API that I can continue to build up.
AUTHOR
Shawn M Moore,
sartak@gmail.com
SEE ALSO
COPYRIGHT AND LICENSE
Copyright 2009 Shawn M Moore.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install IM::Engine::Plugin::State, copy and paste the appropriate command in to your terminal.
cpanm IM::Engine::Plugin::State
perl -MCPAN -e shell install IM::Engine::Plugin::State
For more information on module installation, please visit the detailed CPAN module installation guide.