コード例 #1
0
def webheader(request):
    """ create web header """
    request.wfile.write('<form action="dispatch">')
    request.wfile.write('Command <input name="command"></form><br>')
    cmndslist = cmnds.list('WEB')
    cmndslist.sort()
    request.wfile.write('the bot allows the following commands: .. \
<p>%s</p>' \
% ' '.join(cmndslist))
    request.wfile.write('use chan #channel to provide a channel for \
channel related commands<br>example: search http chan #dunkbots<br><br>')
    #for i in cfg.get('showplugs'):
    #    request.wfile.write("<a href='/%s'>%s</a>" % (i, i))
    #    request.wfile.write("    ")
    request.wfile.write('<br>')
コード例 #2
0
def handle_whatcommands(bot, ievent):
    """ show all commands with permission. """

    if not ievent.rest:
        ievent.missing('<perm>')
        return

    result = cmnds.list(ievent.rest)
    result.sort()

    if not result:
        ievent.reply('no commands known for permission %s' % ievent.rest)
    else:
        ievent.reply('commands known for permission %s: ' % ievent.rest,
                     result)
コード例 #3
0
ファイル: server.py プロジェクト: RetroRodent/my-gozerbot
def webheader(request):
    """ create web header """
    request.wfile.write('<form action="dispatch">')
    request.wfile.write('Command <input name="command"></form><br>')
    cmndslist = cmnds.list('WEB')
    cmndslist.sort()
    request.wfile.write('the bot allows the following commands: .. \
<p>%s</p>' \
% ' '.join(cmndslist))
    request.wfile.write('use chan #channel to provide a channel for \
channel related commands<br>example: search http chan #dunkbots<br><br>')
    #for i in cfg.get('showplugs'):
    #    request.wfile.write("<a href='/%s'>%s</a>" % (i, i))
    #    request.wfile.write("    ")
    request.wfile.write('<br>')
コード例 #4
0
ファイル: core.py プロジェクト: RetroRodent/my-gozerbot
def handle_whatcommands(bot, ievent):

    """ show all commands with permission. """

    if not ievent.rest:
        ievent.missing('<perm>')
        return

    result = cmnds.list(ievent.rest)
    result.sort()

    if not result:
        ievent.reply('no commands known for permission %s' % ievent.rest)
    else:
        ievent.reply('commands known for permission %s: ' % ievent.rest, result)
コード例 #5
0
ファイル: bot.py プロジェクト: GuillaumeFromage/my-gozerbot
    def _dodcc(self, sock, nick, userhost, channel=None):
        """ send welcome message and loop for dcc commands. """

        if not nick or not userhost:
            return

        try:
            # send welcome message .. show list of commands for USER perms
            cmndslist = cmnds.list('USER')
            cmndslist.sort()
            sock.send('Welcome to the GOZERBOT partyline ' + nick + " ;]\n")
            partylist = partyline.list_nicks()
            if partylist:
                sock.send("people on the partyline: %s\n" %
                          ' .. '.join(partylist))
            sock.send("control character is ! .. bot broadcast is @\n")
        except Exception, ex:
            rlog(10, self.name, 'dcc error: %s' % str(ex))
            return
コード例 #6
0
ファイル: bot.py プロジェクト: RetroRodent/my-gozerbot
    def _dodcc(self, sock, nick, userhost, channel=None):

        """ send welcome message and loop for dcc commands. """

        if not nick or not userhost:
            return

        try:
            # send welcome message .. show list of commands for USER perms
            cmndslist = cmnds.list('USER')
            cmndslist.sort()
            sock.send('Welcome to the GOZERBOT partyline ' + nick + " ;]\n")
            partylist = partyline.list_nicks()
            if partylist:
                sock.send("people on the partyline: %s\n" % ' .. '.join(partylist))
            sock.send("control character is ! .. bot broadcast is @\n")
        except Exception, ex:
            rlog(10 , self.name, 'dcc error: %s' % str(ex))
            return