Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Once the bot is installed, run the following command in Discord:
|----------|-------------|--------------|
| **mqttbridge** | Bridge between MQTT and Discord for Meshtastic devices | • Real-time MQTT integration<br>• Node discovery & management<br>• Message bridging to Discord<br>• Telemetry & position tracking<br>• Traceroute visualization<br>• Node ownership system<br>• Administrative controls |
| **strikes** | Comprehensive strike, warning, and note tracking system for server moderation | • Three case types: strikes, warnings, and mod notes<br>• Per-member Discord threads for case discussion<br>• Auto-updating anchor embed with case totals<br>• Configurable auto-actions (kick / ban) at strike thresholds<br>• DM notifications to actioned members<br>• Full case history with pagination<br>• Add, view, and remove individual cases |
| **azmsh_welcome** | Automated Welcome messages. | Simply welcomes new members in the welcome channel. |

## Installation per Cog

Expand All @@ -23,4 +24,5 @@ For example:
```
[p]cog install Meshtastic-Cogs mqttbridge
[p]cog install Meshtastic-Cogs strikes
[p]cog install Meshtastic-Cogs azmsh_welcome
```
4 changes: 4 additions & 0 deletions azmsh_welcome/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .azmsh_welcome import Welcome

async def setup(bot):
await bot.add_cog(Welcome(bot))
33 changes: 33 additions & 0 deletions azmsh_welcome/azmsh_welcome.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from redbot.core import commands, Config
import discord

class Welcome(commands.Cog):
"""Welcome members after onboarding, with duplicate protection."""

def __init__(self, bot):
self.bot = bot
# In-memory cache to track welcomed users this session
self._welcomed_users = set()
# Hardcoded welcome channel ID
self.welcome_channel_id = 1270468564633255936

@commands.Cog.listener()
async def on_member_update(self, before: discord.Member, after: discord.Member):
# Check if the member just finished onboarding
if before.pending and not after.pending:
if after.id in self._welcomed_users:
return # Already welcomed

guild = after.guild
channel = guild.get_channel(self.welcome_channel_id)
if channel is None:
return

# Mark the user as welcomed
self._welcomed_users.add(after.id)

await channel.send(
f"🎉 Welcome to **{guild.name}**, {after.mention}!\n"
"We're excited to have you here! Please check out <#1274440386827255849> and <#1380219375620980828>.\n\n"
"Got some nodes already on the mesh? Link them to your Discord! <#1393444182047064084>"
)
Loading