-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathonboarding.py
More file actions
82 lines (67 loc) · 2.73 KB
/
Copy pathonboarding.py
File metadata and controls
82 lines (67 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import discord
from discord.ext import commands
# === Configurable ===
GREETING_MESSAGE = "Welcome to our Community!"
COMMUNITY_DESCRIPTION = "We are trying to make video games with as many contributors as possible. We are hobbyists, our games are free and open source, no one is paid."
FOOTER_TEXT = """
Only DM Mods, everything else should be done in public!
Type /help [...] or ask in one of the 💬 channels if you don't know where to start or need assistance.
We are always happy to help!
Remember: Everyone is welcome to contribute, no matter your skill level or background.
Some tasks may require specific skills or knowledge, but we can figure it out together!
Either way, you’re welcome to suggest improvements to our projects, game features and workflow.
"""
LINKS_TEXT = "Follow us on [Bluesky](https://bsky.app/profile/godot-collab-jam.bsky.social) and [Itch.io](https://100devs.itch.io/)!"
HIGHLIGHT_CHANNEL_IDS = [
1393365048918802625,
1393312261770051674,
1394481813052850299,
# 1403380646105321502, #where-am-I-needed
1415359369218101258,
1393033401128194061,
]
class Onboarding(commands.Cog):
def __init__(self, bot: discord.Bot):
self.bot = bot
@staticmethod
def build_onboarding_embed(guild: discord.Guild) -> discord.Embed:
embed = discord.Embed(
title=GREETING_MESSAGE,
description=COMMUNITY_DESCRIPTION,
color=discord.Color.green(),
)
channels_text = []
for cid in HIGHLIGHT_CHANNEL_IDS:
channel = guild.get_channel(cid)
if channel:
channels_text.append(f"👉 {channel.mention}")
if channels_text:
embed.add_field(
name="Start by checking out:",
value="\n".join(channels_text),
inline=False,
)
embed.add_field(
name="Need help?",
value=FOOTER_TEXT.strip(),
inline=False,
)
embed.add_field(
name="Links",
value=LINKS_TEXT,
inline=False,
)
return embed
@commands.Cog.listener()
async def on_member_join(self, member: discord.Member):
embed = Onboarding.build_onboarding_embed(member.guild)
try:
await member.send(embed=embed)
except discord.Forbidden:
pass # can't DM the user, ignore
group = discord.SlashCommandGroup("onboarding", "Onboarding commands")
@group.command(name="test", description="Test the onboarding message")
async def test(self, ctx: discord.ApplicationContext):
"""Test the onboarding message."""
embed = Onboarding.build_onboarding_embed(ctx.guild)
await ctx.respond(embed=embed, ephemeral=True)