Search code examples
pythonirc

Python IRC bot weird output


I have written a code that pms and notices specified nickname:

 @hook.command
    def privatemsg(inp,nick="",conn=None):
        conn.cmd('PRIVMSG',[inp,''])
    @hook.command
    def notice(inp,nick="",conn=None):
        conn.cmd('NOTICE',[inp,''])

But the problem shows up when I do .notice Tom hi, it outputs something like -Bot- hi*:* Same happens with .privatemsg Tom hi, outputs -Bot- hi:

How can I remove the :? I've tried changing the '' but it still shows :


Solution

  • I think the correct syntax for notices is

    conn.cmd('NOTICE', [nick, msg])
    

    but there is already a built-in function in skybot for doing this. Take a look at the tell plugin how it is used (which may already implement what you are trying to do?).