机器人程序框架!!

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为游戏添加声音。需要帮助   java在获取数据时忽略模型类中的forign键映射   java为什么Microsoft JDBC驱动程序忽略failoverPartner主机名   java可以下载mozswing文件   java等价于ObjectOutputStream,不仅保存其状态,还保存整个对象?   Java Android LiveData根据其他LiveData调用房间查询   java如何使用jackson jsonNode实现这一点并获得所需的输出   在web服务器上作为web应用程序运行java应用程序?   groovy中java类的元类属性   返回空指针的java图形对象   标头中包含用户名和密码的java SOAP客户端请求   具有堆栈实现和递归的Hanoi算法塔(Java)   java当我运行这两个类时,我的老鼠不会移动   使用图像进行java相似图像搜索   Java8并行流机制   使用单例对象作为枚举元素的java Scala枚举,是否有可能对它们进行迭代?   java Webview更改高度大小   不可序列化对象和函数的java Spark Scala编程   java my app在eclipse中运行良好,而不是在jar中