Skip to content

Initial setup #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
Dec 14, 2023
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
eac4eb0
+ Added CODEOWNERS
caffeine-addictt Dec 13, 2023
903382f
+ Added test worker workflow
caffeine-addictt Dec 13, 2023
e0bbf76
+ Added base runner script
caffeine-addictt Dec 13, 2023
a7d1947
+ Added gitignore
caffeine-addictt Dec 13, 2023
96616a4
+ Added poetry lock and pyproject
caffeine-addictt Dec 13, 2023
aedd0b3
+ Added __init__.py
caffeine-addictt Dec 13, 2023
ca695a4
+ Added base app
caffeine-addictt Dec 13, 2023
c87faad
+ Added utils
caffeine-addictt Dec 13, 2023
804e544
+ Added help commands
caffeine-addictt Dec 13, 2023
ffc119c
+ Added Configuration setup
caffeine-addictt Dec 13, 2023
9a42aa6
+ Added Error manager
caffeine-addictt Dec 13, 2023
18cec89
+ Added type hinting
caffeine-addictt Dec 14, 2023
d1b7002
+ Added runner script
caffeine-addictt Dec 14, 2023
ddbe9d3
Migrated app.py -> __init__.py
caffeine-addictt Dec 14, 2023
54ba9bf
+ Added contributing.md
caffeine-addictt Dec 14, 2023
ed03e0b
+ Added CODESTYLE
caffeine-addictt Dec 14, 2023
d50dc1d
+ Added PR tempalte
caffeine-addictt Dec 14, 2023
c6025ea
+ Added SECURITY.md
caffeine-addictt Dec 14, 2023
ec9d69b
+ Added settings config
caffeine-addictt Dec 14, 2023
1580ed3
+ Added issue templates
caffeine-addictt Dec 14, 2023
528b1a8
+ Added test placeholder
caffeine-addictt Dec 14, 2023
e3388da
- Removed unused import
caffeine-addictt Dec 14, 2023
ef3b9ed
+ Added space
caffeine-addictt Dec 14, 2023
0a11015
+ Custom Comamnd check
caffeine-addictt Dec 14, 2023
df2bff7
+ Developer Commands
caffeine-addictt Dec 14, 2023
4478795
+ Invite manager
caffeine-addictt Dec 14, 2023
99d9120
+ Type hinting
caffeine-addictt Dec 14, 2023
51345e4
+ Config variables
caffeine-addictt Dec 14, 2023
128c8af
+ Added .vscode to gitignore
caffeine-addictt Dec 14, 2023
0f3fa6b
+ Added checking for bot token
caffeine-addictt Dec 14, 2023
0bce957
+ Bug fix
caffeine-addictt Dec 14, 2023
8a611ff
Type hint Bot token optional
caffeine-addictt Dec 14, 2023
fd5955f
Update cog name
caffeine-addictt Dec 14, 2023
905f039
Fixed parameter namespace
caffeine-addictt Dec 14, 2023
6de5aee
+ Added view pagination
caffeine-addictt Dec 14, 2023
0ded28e
Refactor help command
caffeine-addictt Dec 14, 2023
36303ea
Refactor invite manager
caffeine-addictt Dec 14, 2023
3ba50fc
+ Added misc commands
caffeine-addictt Dec 14, 2023
1a06b8b
+ Added emoji dependency
caffeine-addictt Dec 14, 2023
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
Prev Previous commit
Next Next commit
Refactor invite manager
  • Loading branch information
caffeine-addictt committed Dec 14, 2023
commit 36303ea027244d96fd03f440dd5a0640c6741e31
9 changes: 6 additions & 3 deletions src/cogs/invite_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import discord
from discord import app_commands
from discord.ext import commands
from typing import Optional

from src.utils import Embeds, Error
from src.config import Config
Expand All @@ -12,6 +12,9 @@ class Invite(commands.Cog):
Handles welcoming new members
"""

client: commands.Bot


def __init__(self, client: commands.Bot) -> None:
self.client = client

Expand All @@ -24,9 +27,9 @@ async def on_ready(self):
@commands.Cog.listener()
async def on_member_join(self, member: discord.Member):
guild = self.client.get_guild(Config.GUILD_ID)
welcome_channel = guild.get_channel(Config.WELCOME_CHANNEL_ID)
welcome_channel = guild and guild.get_channel(Config.WELCOME_CHANNEL_ID)

if welcome_channel:
if welcome_channel and isinstance(welcome_channel, discord.TextChannel):
await welcome_channel.send(member.mention, embed = Embeds(
title = member.global_name,
description = f'**Welcome to the server!** 🎉\n\nDon\'t forget to `git checkout `<#{Config.RULE_CHANNEL_ID}>'
Expand Down