This commit is contained in:
Robin
2025-10-06 14:20:28 +02:00
commit f0c8fe734a
16 changed files with 1360 additions and 0 deletions

26
cogs/welcome.py Normal file
View File

@@ -0,0 +1,26 @@
import discord
from discord.ext import commands
from discord import app_commands
class Welcome(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.Cog.listener()
async def on_member_join(self, member: discord.Member):
"""Wird ausgelöst, wenn ein neues Mitglied dem Server beitritt."""
guild = member.guild
welcome_channel = guild.system_channel
if welcome_channel is not None:
embed = discord.Embed(
title=f"Willkommen auf {guild.name}!",
description=f"Hallo {member.mention}, wir freuen uns, dich hier zu sehen! Schau dich doch mal um.",
color=discord.Color.green()
)
embed.set_thumbnail(url=member.avatar.url if member.avatar else member.default_avatar.url)
embed.set_footer(text=f"Du bist das {guild.member_count}. Mitglied!")
await welcome_channel.send(embed=embed)
async def setup(bot: commands.Bot):
await bot.add_cog(Welcome(bot))