Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
9c46b5fc7c | |||
18c70b1f56 |
@ -108,7 +108,7 @@ class PyIRCBotSub(PrimitiveBot):
|
||||
return self
|
||||
return super().getBestModuleForService(service)
|
||||
|
||||
def nick(self):
|
||||
def get_nick(self):
|
||||
return self.meta.get("nick", None)
|
||||
|
||||
|
||||
|
3
examples/data/config/XDCC.json
Normal file
3
examples/data/config/XDCC.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"share": "/home/dave/Code/my/pyircbot3/share"
|
||||
}
|
22
pyircbot/modules/XDCC.py
Normal file
22
pyircbot/modules/XDCC.py
Normal file
@ -0,0 +1,22 @@
|
||||
"""
|
||||
.. module::XDCC
|
||||
:synopsis: Provide XDCC filebot functionality
|
||||
.. moduleauthor::Dave Pedu <dave@davepedu.com>
|
||||
"""
|
||||
import os
|
||||
from pyircbot.modulebase import ModuleBase, command, hook, regex
|
||||
from pyircbot.modules.ModInfo import info
|
||||
from pyircbot.modules.DCC import int2ip
|
||||
from threading import Thread
|
||||
|
||||
|
||||
class XDCC(ModuleBase):
|
||||
def __init__(self, bot, name):
|
||||
super().__init__(bot, name)
|
||||
self.dcc = self.bot.getBestModuleForService("dcc")
|
||||
|
||||
@regex(r'cdc list', types=['PRIVMSG'])
|
||||
def xdcc_list(self, msg, match):
|
||||
files = sorted(os.listdir(self.config.get("share")))
|
||||
for i, f in enumerate(files):
|
||||
self.bot.act_PRIVMSG(msg.args[0], "{}: {}: {}".format(msg.prefix.nick, i, f))
|
Loading…
Reference in New Issue
Block a user