https://github.com/puhoy/sleekbasebot
xmpp bot mini framework
https://github.com/puhoy/sleekbasebot
Last synced: about 1 month ago
JSON representation
xmpp bot mini framework
- Host: GitHub
- URL: https://github.com/puhoy/sleekbasebot
- Owner: puhoy
- License: mit
- Created: 2015-11-14T17:22:38.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-18T14:10:31.000Z (over 9 years ago)
- Last Synced: 2025-03-16T22:04:20.160Z (2 months ago)
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sleekbasebot
### sleekxmpp bot mini framework
just add settings and implement commands.
from sleekbasebot.decorators import arguments, admin_only
from sleekbasebot.commands import help
from sleekbasebot import SleekBaseBot
import logging
@admin_only(reply_string='you are no admin!')
@arguments('first_argument', min=1, usage='!echo \necho the first argument')
def command_echo(msg, **kwargs):
logging.debug('sending echo')
msg.reply(kwargs['first_argument']).send()
commands = {
#'command-trigger_in_chat': executed_command,
'!echo': command_echo,
'!help': help.command_help # help generates a dynamic help from usage in commands
}
settings = {
'admins': ['[email protected]', '[email protected]'],
'autojoin': [['[email protected]', 'p4ssw0rd'], ['[email protected]', 'p@sswOrd']],
'muc_logging': 'log/path/' # or False
}
if __name__ == '__main__':
bot = SleekBaseBot(jid='[email protected]', password='p4ssw0rd', commands=commands, settings=settings)if bot.connect():
bot.process(blocking=False)
else:
print("Unable to connect.")see examples for a better echobot :)