机器人程序框架!!

botje的Python项目详细描述


简介

Botje是一个python3框架,您可以使用它来编写机器人程序。
Botje使您能够编程您自己的模块以启用您自己的命令。
botje包含可用于编程的多个模块。
Botje拥有麻省理工学院无条款许可证。

安装

如果机器人不工作,您可能需要执行以下操作:

bart@okdan:~/botje$ export PYTHONPATH="."
bart@okdan:~/botje$ export PYTHONIOENCODING="utf-8"

克隆源:

bart@okdan:~$ hg clone https://bitbucket.org/bthate/botje
bart@okdan:~$ cd botje
bart@okdan:~/botje$ ./bin/botje --shell

另一个选择是使用pip3下载并全局安装:

bart@okdan:~$ pip3 install botje --upgrade
bart@okdan:~$ ./botje --shell

IRC

使用botje irc程序连接到irc服务器。

bart@okdan:~$ botje-irc -n botje -s irc.freenode.net -c \#dunkbots --shell

xmpp

使用botje xmpp连接到xmpp服务器

bart@okdan:~$ botje-xmpp -u monitor@localhost --room test@conference.localhost --shell

用户

需要添加一个用户源代码,以便能够发出bot命令。可以使用meet命令添加用户:

bart@okdan:~$ botje meet user@server
user user@server created

要授予用户权限,可以使用perm命令:

bart@okdan:~$ botje perm user@server ps
ok user@server

默认的shell用户是root@shell,允许访问所有可用的命令。

编程

用户编程模块是从~/.mods目录中读取的,您可以将.py文件放在那里。

示例:

def hi(event):
    event.reply("hi %s" % event.origin)

模块

NameDescription
botbot package.
bot.clicommand line interface bot.
bot.clocktimer, repeater. timed daemon.
bot.cmdsbot commands package.
bot.cmds.clockclock related commands.
bot.cmds.dbdatabase related commands.
bot.cmds.docdocumentation related commands.
bot.cmds.editcommand to edit json files.
bot.cmds.emailemail commands.
bot.cmds.inputinput module.
bot.cmds.licenselicense command
bot.cmds.loaderloader related commands.
bot.cmds.opernone
bot.cmds.rssrss related commands.
bot.cmds.testtest commands.
bot.cmds.usersuser management.
bot.dbaccess saved json files.
bot.dccdirect client to client bot.
bot.definesnone
bot.eventevent class.
bot.handlerevent handler based on queue.queue.
bot.ircirc bot.
bot.loaderload modules.
bot.objobject class with save/load of json files.
bot.rawraw output using print.
bot.rssrss module (needs feedparser).
bot.selectselect based loop.
bot.thrthreading module.
bot.udprelay txt through a udp port listener.
bot.usersregister an user and give them user , oper or uber permission.
bot.utilsbotje utils package.
bot.utils.decoratorsdecorators module.
bot.utils.loglog module to set standard format of logging.
bot.utils.shellshell related functionality.
bot.utils.timetimed helper functions.
bot.utils.tracestack trace helper functions.
bot.utils.urlfunctions that fetch data from url.
bot.xmppxmpp bot (requires sleekxmpp).

命令

现在在Botje有60多个命令可用。

NameDescription
beginbegin stopwatch.
endstop stopwatch.
timertimer command to schedule a text to be printed on a given time. stopwatch to measure elapsed time.
attrshow attributes of an object type.
deletedshow deleted records.
findpresent a list of objects based on prompt input.
firstshow the first record matching the given criteria.
fixfix a object by loading and saving it.
lastshow last objectect matching the criteria.
lsshow subdirs in working directory.
restoreset deleted=false in selected records.
rmset deleted flag on objects.
todayshow last week’s logged objects.
weekshow last week’s logged objects.
yesterdayshow last week’s logged objects.
cmdsshow list of commands.
manshow descriptions of the available commands.
modsshow available modules.
modulesshow available modules.
uptimeshow uptime.
versionshow version.
editedit and save objects.
mboxconvert emails to botje objects.
loglog some text.
rssadd a rss url.
shopadd a shopitem to the shopping list.
todolog a todo item.
tomorrowshow todo items for tomorrow.
reloadreload a plugin.
startstart a plugin.
stopstop a plugin.
exitstop the program.
loadforce a plugin reload.
pidshow pid of the bot.
psshow running threads.
quitstop the program.
rebootreboot the ldr, allowing statefull reboot (keeping connections alive).
testecho origin.
tinderloop an command nr of times.
delpermdelete permissions of an user.
meetcreate an user record.
permadd/change permissions of an user.
permissionsshow permissions granted to a user.
permsshow permission of user.
ushow user selected by userhost.
wshow user data.

联系人

你可以发邮件给我,也可以通过irc/freenode/dunkbots联系我。

在dunkbots irc.freenode.net上创建父节点

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
在Java中使用Kotlin值类   在Hadoop中表示大文本块作为键的java   java安卓工作室;布局设计视图;   字典Java确定字符串是否以映射中的键开头   JavaG1:混合gc和完全gc之间有什么区别?   java Camunda升级组织。阿帕奇。平民语言错误   java Scanner类具有NextLine无限循环   安卓 GCM Java服务器:发送带有重音字符的消息   java我正在构建一个兴趣计算应用程序,我的项目构建良好,有1个警告,但它不会在我的设备上打开   java在Tilera TileGX上构建OpenJDK 8   GUI中的java惰性初始化与急切初始化   java JodaTime四舍五入到最近的一刻钟   java如何限制菜单。SpringRoo中的jspx可以避免对其他用户的实体执行CRUD操作   java我应该将缓冲流链接到输入流,还是在将声音库作为嵌入式资源加载时使用URL类?