Set mode +R on connect
This commit is contained in:
parent
564c41aba0
commit
73bebd503e
@ -3,6 +3,7 @@ import os
|
||||
import sys
|
||||
import json
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
from dotenv import load_dotenv
|
||||
from irc3 import IrcBot
|
||||
|
||||
@ -23,7 +24,6 @@ CFG_DEV = {
|
||||
}
|
||||
|
||||
|
||||
# TODO: regex
|
||||
# TODO: ddg
|
||||
def main(cfg_file):
|
||||
# Load dotenv from file
|
||||
@ -42,7 +42,9 @@ def main(cfg_file):
|
||||
|
||||
# Start the bot with constructed config
|
||||
bot = IrcBot.from_config(cfg)
|
||||
|
||||
bot.run()
|
||||
bot.mode(bot.nick, '+R')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -2,6 +2,7 @@
|
||||
import logging
|
||||
|
||||
import irc3
|
||||
# noinspection PyPackageRequirements
|
||||
from docopt import Dict as DocOptDict
|
||||
from irc3.plugins.command import command
|
||||
from irc3.utils import IrcString
|
||||
@ -20,13 +21,19 @@ def reload(bot: irc3.IrcBot, mask: IrcString, target: IrcString,
|
||||
"""
|
||||
plugin = args.get('<plugin>')
|
||||
if plugin:
|
||||
bot.reload('{module}.{plugin}'.format(plugin=plugin, module=MODULE))
|
||||
bot.privmsg(target, 'Reloaded plugin "{plugin}"'.format(plugin=plugin))
|
||||
bot.reload('{}.{}'.format(plugin, MODULE))
|
||||
bot.privmsg(target, 'Reloaded plugin "{}"'.format(plugin))
|
||||
else:
|
||||
bot.reload()
|
||||
bot.privmsg(target, 'Reloaded the bot')
|
||||
|
||||
|
||||
@irc3.event(irc3.rfc.CONNECTED)
|
||||
def connected(bot, srv, me, data):
|
||||
bot.mode(me, '+R')
|
||||
|
||||
|
||||
@irc3.plugin
|
||||
class Admin(Plugin):
|
||||
# TODO: add admin functions (join, part, etc)
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user