mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-05-02 00:11:06 -05:00
RelayNext: add events.relaySelfMessages option to toggle relaying the bot's output
Closes #98.
This commit is contained in:
parent
2baceb609e
commit
2e296b38ff
@ -1,5 +1,5 @@
|
||||
###
|
||||
# Copyright (c) 2015-2018 James Lu <james@overdrivenetworks.com>
|
||||
# Copyright (c) 2015-2020 James Lu <james@overdrivenetworks.com>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -95,5 +95,9 @@ for ev in _events:
|
||||
conf.registerChannelValue(RelayNext.events, 'userIgnored',
|
||||
registry.SpaceSeparatedListOfStrings(['PRIVMSG', 'MODE'], ("""Determines what events
|
||||
the relay should ignore from ignored users. Ignores are added using
|
||||
Supybot's global ignore system.""")))
|
||||
Limnoria's global ignore system.""")))
|
||||
conf.registerChannelValue(RelayNext.events, 'relaySelfMessages',
|
||||
registry.Boolean(True, ("""Determines whether the bot should relay its own messages.
|
||||
You may wish to disable this if you are running plugins that announce to the same channel
|
||||
on multiple networks (e.g. RSS).""")))
|
||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||
|
@ -1,5 +1,5 @@
|
||||
###
|
||||
# Copyright (c) 2015-2018 James Lu <james@overdrivenetworks.com>
|
||||
# Copyright (c) 2015-2020 James Lu <james@overdrivenetworks.com>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -367,7 +367,8 @@ class RelayNext(callbacks.Plugin):
|
||||
# Catch our own messages and send them into the relay (this is
|
||||
# useful because Supybot is often a multi-purpose bot!)
|
||||
try:
|
||||
if msg.command == 'PRIVMSG' and not msg.relayedMsg:
|
||||
if msg.command == 'PRIVMSG' and not msg.relayedMsg and \
|
||||
self.registryValue("events.relaySelfMessages", msg.args[0]):
|
||||
new_msg = deepcopy(msg)
|
||||
new_msg.nick = irc.nick
|
||||
self.relay(irc, new_msg, channel=msg.args[0])
|
||||
|
Loading…
x
Reference in New Issue
Block a user