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