File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ import discord
2
+ from discord import app_commands
3
+ from discord .ext import commands
4
+
5
+ from src .utils import Embeds , Error
6
+ from src .config import Config
7
+
8
+
9
+ class Invite (commands .Cog ):
10
+ """hidden
11
+
12
+ Handles welcoming new members
13
+ """
14
+
15
+ def __init__ (self , client : commands .Bot ) -> None :
16
+ self .client = client
17
+
18
+
19
+ @commands .Cog .listener ()
20
+ async def on_ready (self ):
21
+ print ('Invite Manager UP' )
22
+
23
+
24
+ @commands .Cog .listener ()
25
+ async def on_member_join (self , member : discord .Member ):
26
+ guild = self .client .get_guild (Config .GUILD_ID )
27
+ welcome_channel = guild .get_channel (Config .WELCOME_CHANNEL_ID )
28
+
29
+ if welcome_channel :
30
+ await welcome_channel .send (member .mention , embed = Embeds (
31
+ title = member .global_name ,
32
+ description = f'**Welcome to the server!** 🎉\n \n Don\' t forget to `git checkout `<#{ Config .RULE_CHANNEL_ID } >'
33
+ ))
34
+
35
+
36
+ async def setup (client : commands .Bot ):
37
+ await client .add_cog (Invite (client ))
You can’t perform that action at this time.
0 commit comments