Awesome IRC bot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
734 B

"""
.. 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))