Update readme. remove prints

Dieser Commit ist enthalten in:
Russell 2019-02-08 16:21:50 -05:00
Ursprung cfe6729467
Commit 9a306a0a82
2 geänderte Dateien mit 11 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -90,6 +90,17 @@ It also contains the following IRC functions:
* `action`: same as privmsg, but does a CTCP action. (i.e., `/me does a thing`)
* `notice`: send a notice
You can optionally use the `@pinhook.plugin.ops` decorator to denote that a command should only be executable by a bot op.
* If you specify the optional second argument, it will be displayed when a non-op attempts to execute the command
The function will need to be structured as such:
```python
@pinhook.plugin.register('!test')
@pinhook.plugin.ops('!test', 'Only ops can run this command!')
def test_plugin(msg):
return pinhook.plugin.message('This was run by an op!')
```
**OR**
The plugin function can return one of the following in order to give a response to the command:

Datei anzeigen

@ -11,7 +11,6 @@ import irc.bot
irc.client.ServerConnection.buffer_class.errors = 'replace'
print('LOADED LOCAL!')
class Bot(irc.bot.SingleServerIRCBot):
def __init__(self, channels, nickname, server, **kwargs):
@ -136,7 +135,6 @@ class Bot(irc.bot.SingleServerIRCBot):
self.process_event(c, e)
def call_help(self, op):
print('HELP', pinhook.plugin.cmds)
helplist = sorted([i for i in pinhook.plugin.cmds if op or not ('ops' in pinhook.plugin.cmds[i] and pinhook.plugin.cmds[i]['ops'])])
msg = ', '.join(helplist)
return self.output_message('Available commands: {}'.format(msg))