From d97e7fa7b5648b384885279ea770930823add78b Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 30 Mar 2025 04:10:46 -0400 Subject: [PATCH] Added a greet plugin for messages to be sent when people join a channel. --- Greet/README.md | 66 ++++++ Greet/__init__.py | 9 + Greet/__pycache__/plugin.cpython-313.pyc | Bin 0 -> 11580 bytes Greet/config.py | 27 +++ Greet/plugin.py | 254 +++++++++++++++++++++++ Greet/test.py | 46 ++++ Weather/plugin.py | 2 +- 7 files changed, 403 insertions(+), 1 deletion(-) create mode 100644 Greet/README.md create mode 100644 Greet/__init__.py create mode 100644 Greet/__pycache__/plugin.cpython-313.pyc create mode 100644 Greet/config.py create mode 100644 Greet/plugin.py create mode 100644 Greet/test.py diff --git a/Greet/README.md b/Greet/README.md new file mode 100644 index 0000000..d65775a --- /dev/null +++ b/Greet/README.md @@ -0,0 +1,66 @@ +# Greet Plugin for Limnoria + +A simple plugin that greets users when they join a channel, with built-in flood protection and timeout features. + +## Features + +- Set custom greeting messages per channel +- Timeout between join and greeting to handle multiple users joining at once +- Cooldown feature to prevent flooding for users with unstable connections +- Simple commands to enable, disable, or clear greetings +- Debug mode for easier troubleshooting + +## Installation + +1. Copy the `Greet` directory to your Limnoria's plugins directory: + ``` + ~/yourbot/plugins/ + ``` + +2. Load the plugin: + ``` + @load Greet + ``` + +## Commands + +The plugin now uses namespaced commands to avoid conflicts with other plugins: + +- `greet #channel Your greeting message` - Sets the greeting message and enables it +- `greetstatus #channel` - Shows the current greeting status and message +- `greeton #channel` - Enables the greeting for a channel +- `greetoff #channel` - Disables the greeting for a channel +- `greetclear #channel` - Clears the greeting message and disables it +- `greettimeout #channel 5` - Sets the timeout in seconds (default is 3) +- `greettest #channel` - Tests the greeting by sending it immediately +- `greettrigger #channel` - Simulates a join event with timeout (owner only) +- `greetdebug on|off` - Enables or disables debug mode (owner only) + +## Examples + +``` +.greet #a11y-offtopic Welcome to the off-topic channel! +.greetstatus #a11y-offtopic +.greettimeout #a11y-offtopic 5 +.greetoff #a11y-offtopic +.greeton #a11y-offtopic +.greetclear #a11y-offtopic +.greettest #a11y-offtopic +``` + +## How It Works + +When a user joins a channel, the plugin checks if greetings are enabled for that channel. If enabled, it waits for the configured timeout period to see if more users join. After the timeout expires, it sends the greeting message. + +The plugin also implements a cooldown period (5 minutes by default) for each user to prevent multiple greetings to the same user in case of connection issues. + +## Troubleshooting + +If you're experiencing issues: + +1. Enable debug mode: `.greetdebug on` (owner only) +2. Test the greeting: `.greettest #channel` +3. Check if the greeting is enabled: `.greetstatus #channel` +4. Try triggering a simulated join: `.greettrigger #channel` (owner only) + +The debug mode will output information about join events and greeting attempts to help diagnose any problems. diff --git a/Greet/__init__.py b/Greet/__init__.py new file mode 100644 index 0000000..82527db --- /dev/null +++ b/Greet/__init__.py @@ -0,0 +1,9 @@ +### +# Copyright (c) 2025, Stormux +# +# This plugin is licensed under the same terms as Limnoria itself. +### + +from . import config, plugin + +Class = plugin.Class diff --git a/Greet/__pycache__/plugin.cpython-313.pyc b/Greet/__pycache__/plugin.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69b913b5f4e8f62268efdeb270ae75af51c67da1 GIT binary patch literal 11580 zcmey&%ge>Uz`#)S>qUB*3IoGq5C?`?p^VRK7#J9)G6XXOGkP<4F%~f@fY?mlOy*2r z7Na+_7fTTfl+EhJR>THnvwLwAaX{IeUR*_7P&T(0PZ1B4&FjTi#0O>bdkGW?K-q#t zf?ykkii9K>lo*1Ur5J))VmN}-psqrqOqn5^B9R!8BGGh4P1ctn0Y6Q~TZ~%CASMj6 zKpCI?7#SGi7^X7BFcdKcGZZleGZrxiGZnFfGMF%etjgjjVhv`IVklw@W|d+nVvpfa zVhCo_XEbGmm=Me^#b63yG8A!wWjTV`^qJuDoJjIqPME={!iXJQ%XP zNV2>bvV2Igd>FF)NV5D8*rN@jva1&9L0F(^TNp1{DsV8=L>AsQNI3=Gk5b)gKVPfn^{saS2#5Br`Yl77r*8 zo%8c^Qu535ZgH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W_!l?%NEUUs%$a8T}bMJR!pjUl_pL O4?*kEV90m? literal 0 HcmV?d00001 diff --git a/Greet/config.py b/Greet/config.py new file mode 100644 index 0000000..45a7c00 --- /dev/null +++ b/Greet/config.py @@ -0,0 +1,27 @@ +### +# Copyright (c) 2025, Stormux +# +# This plugin is licensed under the same terms as Limnoria itself. +### + +import supybot.conf as conf +import supybot.registry as registry + +def configure(advanced): + # This will be called by supybot to configure this module. + from supybot.questions import expect, anything, something, yn + conf.registerPlugin('Greet', True) + +Greet = conf.registerPlugin('Greet') + +conf.registerChannelValue(Greet, 'enabled', + registry.Boolean(False, """Determines whether greetings are enabled for a channel.""")) + +conf.registerChannelValue(Greet, 'message', + registry.String('', """The greeting message to be sent to the channel.""")) + +conf.registerChannelValue(Greet, 'timeout', + registry.PositiveInteger(3, """The number of seconds to wait after a join + before sending a greeting.""")) + +# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: diff --git a/Greet/plugin.py b/Greet/plugin.py new file mode 100644 index 0000000..632b136 --- /dev/null +++ b/Greet/plugin.py @@ -0,0 +1,254 @@ +### +# Copyright (c) 2025, Stormux +# +# This plugin is licensed under the same terms as Limnoria itself. +### + +import supybot.utils as utils +from supybot.commands import * +import supybot.plugins as plugins +import supybot.ircutils as ircutils +import supybot.callbacks as callbacks +import supybot.world as world +import supybot.schedule as schedule +import supybot.conf as conf +import supybot.ircmsgs as ircmsgs +import time +import re + +class Greet(callbacks.Plugin): + """ + A plugin to greet users when they join a channel. + Features flood protection and timeout between greetings. + """ + + def __init__(self, irc): + self.__parent = super(Greet, self) + self.__parent.__init__(irc) + + # Dictionary to store last greeting times per user + self.lastGreetTime = {} + + # Default cooldown between greetings for the same user (in seconds) + self.userCooldown = 300 # 5 minutes + + # Debug mode + self.debugMode = False + + def doJoin(self, irc, msg): + """ + Called when someone joins a channel. + """ + channel = msg.args[0] + nick = msg.nick + + # Log event for debugging + if self.debugMode: + self._logDebug(irc, f"JOIN event detected: {nick} joined {channel}") + + # Don't greet ourselves + if nick == irc.nick: + if self.debugMode: + self._logDebug(irc, f"Not greeting self (bot)") + return + + # Check if greetings are enabled for this channel + if not self.registryValue('enabled', channel): + if self.debugMode: + self._logDebug(irc, f"Greetings disabled for {channel}") + return + + # Get the greeting message for this channel + greeting = self.registryValue('message', channel) + if not greeting: + if self.debugMode: + self._logDebug(irc, f"No greeting message set for {channel}") + return + + # Check if this user was greeted recently + userKey = f"{nick.lower()}@{channel}" + now = time.time() + if userKey in self.lastGreetTime: + lastTime = self.lastGreetTime[userKey] + if now - lastTime < self.userCooldown: + if self.debugMode: + self._logDebug(irc, f"User {nick} was greeted too recently") + return + + # Get the timeout + timeout = self.registryValue('timeout', channel) or 3 + + if self.debugMode: + self._logDebug(irc, f"Will greet in {channel} after {timeout}s: {greeting}") + + # Update last greet time for this user + self.lastGreetTime[userKey] = now + + # Use a closure to capture the current values + def sendGreeting(channelToGreet=channel, greetingMsg=greeting): + if self.debugMode: + self._logDebug(irc, f"Sending greeting in {channelToGreet}: {greetingMsg}") + try: + # Make sure the channel is still valid when we send the message + if channelToGreet in irc.state.channels: + irc.queueMsg(ircmsgs.privmsg(channelToGreet, greetingMsg)) + except Exception as e: + if self.debugMode: + self._logDebug(irc, f"Error sending greeting: {str(e)}") + + # Schedule the greeting + schedule.addEvent(sendGreeting, time.time() + timeout) + + def _logDebug(self, irc, message): + """Send debug messages to the first available channel""" + try: + # Send to the owner via private message instead of to a channel + for owner in self.registryValue('owners') or []: + irc.queueMsg(ircmsgs.privmsg(owner, f"[GREET-DEBUG] {message}")) + return + + # Fallback: send to the first available channel + for channel in list(irc.state.channels): + try: + irc.queueMsg(ircmsgs.privmsg(channel, f"[GREET-DEBUG] {message}")) + break + except: + continue + except Exception as e: + # Last resort, log to Supybot's logs + self.log.error(f"Debug logging error: {str(e)}") + + @wrap(['channel']) + def greettest(self, irc, msg, args, channel): + """[] + + Test the greeting by sending it immediately. + """ + greeting = self.registryValue('message', channel) + if greeting: + irc.queueMsg(ircmsgs.privmsg(channel, greeting)) + irc.replySuccess("Greeting test sent") + else: + irc.error("No greeting message is set for this channel") + + @wrap(['owner', 'channel']) + def greettrigger(self, irc, msg, args, channel): + """[] + + Simulates a join event with timeout (owner only). + """ + greeting = self.registryValue('message', channel) + if not greeting: + irc.error(f"No greeting message is set for {channel}") + return + + # Get the timeout + timeout = self.registryValue('timeout', channel) or 3 + + irc.replySuccess(f"Simulating join event with {timeout}s delay") + + # Schedule the greeting + def sendGreeting(): + irc.queueMsg(ircmsgs.privmsg(channel, greeting)) + + schedule.addEvent(sendGreeting, time.time() + timeout) + + @wrap(['owner', 'boolean']) + def greetdebug(self, irc, msg, args, enable): + """ + + Enables or disables debug mode (owner only). + """ + self.debugMode = enable + if enable: + irc.replySuccess("Debug mode enabled") + else: + irc.replySuccess("Debug mode disabled") + + @wrap(['channel']) + def greeton(self, irc, msg, args, channel): + """[] + + Enables greetings for a channel. + """ + self.setRegistryValue('enabled', True, channel) + greeting = self.registryValue('message', channel) + if greeting: + irc.replySuccess(f"Greetings enabled for {channel}. Current greeting: \"{greeting}\"") + else: + irc.error(f"Greetings enabled for {channel}, but no greeting message is set.") + + @wrap(['channel']) + def greetoff(self, irc, msg, args, channel): + """[] + + Disables greetings for a channel. + """ + self.setRegistryValue('enabled', False, channel) + irc.replySuccess(f"Greetings disabled for {channel}.") + + @wrap(['channel']) + def greetclear(self, irc, msg, args, channel): + """[] + + Removes the greeting message for a channel. + """ + self.setRegistryValue('message', '', channel) + self.setRegistryValue('enabled', False, channel) + irc.replySuccess(f"Greeting message cleared and disabled for {channel}.") + + @wrap(['channel']) + def greetstatus(self, irc, msg, args, channel): + """[] + + Shows the current greeting status and message for a channel. + """ + enabled = self.registryValue('enabled', channel) + message = self.registryValue('message', channel) + timeout = self.registryValue('timeout', channel) or 3 + + if enabled and message: + irc.reply(f"Greetings are enabled for {channel}. Timeout: {timeout} seconds. Message: \"{message}\"") + elif enabled and not message: + irc.reply(f"Greetings are enabled for {channel}, but no message is set.") + else: + irc.reply(f"Greetings are disabled for {channel}. Message: \"{message or 'None'}\"") + + @wrap(['channel', 'positiveInt']) + def greettimeout(self, irc, msg, args, channel, seconds): + """[] + + Sets the timeout in seconds between joins before sending a greeting. + Default is 3 seconds. + """ + self.setRegistryValue('timeout', seconds, channel) + irc.replySuccess(f"Greeting timeout for {channel} set to {seconds} seconds.") + + @wrap(['channel', 'text']) + def greet(self, irc, msg, args, channel, text): + """[] + + Sets the greeting message for a channel. + The greeting will be sent when users join the channel, with flood +protection. + + To manage greetings, use the other commands: + greeton - Enables greetings for the channel + greetoff - Disables greetings for the channel + greetclear - Removes the greeting message for the channel + greetdebug on|off - Enables/disables debug mode (owner only) + greettest - Immediately sends the greeting to test the message + greettrigger - Simulates a join event with timeout (owner only) + greetstatus - Shows current status and message + greettimeout - Sets delay before greeting + + Examples: + greet #channel Welcome to our channel! + """ + self.setRegistryValue('message', text, channel) + self.setRegistryValue('enabled', True, channel) + irc.replySuccess(f"Greeting message for {channel} set to: \"{text}\"") + +Class = Greet + +# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: diff --git a/Greet/test.py b/Greet/test.py new file mode 100644 index 0000000..aef13f4 --- /dev/null +++ b/Greet/test.py @@ -0,0 +1,46 @@ +### +# Copyright (c) 2025, Stormux +# +# This plugin is licensed under the same terms as Limnoria itself. +### + +from supybot.test import * + +class GreetTestCase(PluginTestCase): + plugins = ('Greet',) + + def testGreet(self): + # Set a greeting message + self.assertNotError('greet #test Hello, world!') + # Check if it's enabled + self.assertRegexp('greetstatus #test', 'enabled') + # Disable it + self.assertNotError('greetoff #test') + # Check if it's disabled + self.assertRegexp('greetstatus #test', 'disabled') + # Enable it again + self.assertNotError('greeton #test') + # Check if it's enabled + self.assertRegexp('greetstatus #test', 'enabled') + # Clear it + self.assertNotError('greetclear #test') + # Check if it's cleared and disabled + self.assertRegexp('greetstatus #test', 'disabled') + + def testTimeout(self): + # Set a timeout + self.assertNotError('greettimeout #test 5') + # Check if it's set + self.assertRegexp('greetstatus #test', '5 seconds') + + def testTestAndTrigger(self): + # Set a greeting message + self.assertNotError('greet #test Hello, world!') + # Test it + self.assertNotError('greettest #test') + # Since we can't really test greettrigger in a unit test (it's + # time-based) + # we'll just check if the command is recognized + # Owner-only commands can't be tested directly here + +# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: diff --git a/Weather/plugin.py b/Weather/plugin.py index 1561320..2ac5a98 100644 --- a/Weather/plugin.py +++ b/Weather/plugin.py @@ -1,5 +1,5 @@ ### -# Copyright (c) 2025, Your Name +# Copyright (c) 2025, Stormux # # This plugin is licensed under the same terms as Limnoria itself. ###