|
4 | 4 | TOKEN = os.getenv("TOKEN") |
5 | 5 | REACTION_MESSAGE_ID = os.getenv("REACTION_MESSAGE_ID") |
6 | 6 | REACTION_ROLE_ID = os.getenv("REACTION_ROLE_ID") |
| 7 | +PUBLIC_REMINDER_CHANNEL_ID = os.getenv("PUBLIC_REMINDER_CHANNEL_ID") |
| 8 | +PUBLIC_REMINDER_START = os.getenv("PUBLIC_REMINDER_START") |
7 | 9 | VOUCH_REMINDER_CHANNEL_ID = os.getenv("VOUCH_REMINDER_CHANNEL_ID") |
8 | 10 | VOUCH_REMINDER_START = os.getenv("VOUCH_REMINDER_START") |
9 | 11 | SERVER_ACCESS_ROLE_ID = os.getenv("SERVER_ACCESS_ROLE_ID") |
|
20 | 22 | :star: Take your time exploring our server. Starting with the channels under the Main folder 📂 might be good. |
21 | 23 | 📌 Look through pinned posts for important info.""" |
22 | 24 |
|
23 | | -WEEKLY_MESSAGE = """ |
| 25 | +PUBLIC_REMINDER_MESSAGE = """ |
24 | 26 | Hi everyone! If you're waiting to get access to the full server, please don't say who invited you or post an intro yet. |
25 | 27 |
|
26 | | -To get access, you need to react to the server guidelines post https://discord.com/channels/1073227549867520101/1200982159826108456/1200983315730145443, and the person who invited you needs to vouch for you in a private channel. One of the mods will then give you access manually. Thanks! |
| 28 | +To get access, you need to react to the server guidelines post https://discord.com/channels/1073227549867520101/1200982159826108456/1200983315730145443, and the person who invited you needs to vouch for you in a priv""" |
27 | 29 |
|
28 | | -Also - reminder to please vouch for folks in the welcome and introductions channel!""" |
| 30 | +VOUCH_REMINDER_MESSAGE = """ |
| 31 | +Reminder to please vouch for folks in the welcome and introductions channel!""" |
29 | 32 |
|
30 | 33 | logger = logging.getLogger('discord') |
31 | 34 |
|
@@ -66,10 +69,17 @@ async def on_error(event, *args, **kwargs): |
66 | 69 | # TASKS |
67 | 70 |
|
68 | 71 | @tasks.loop(seconds=SECONDS_IN_HOUR) # will run again after this time elapses *and* the previous execution has completed |
69 | | -async def weekly_message(): |
| 72 | +async def public_weekly_message(): |
| 73 | + seconds_until_next_reminder = SECONDS_IN_WEEK - ((int(time.time()) - int(PUBLIC_REMINDER_START)) % SECONDS_IN_WEEK) |
| 74 | + if seconds_until_next_reminder <= SECONDS_IN_HOUR: |
| 75 | + await client.get_channel(int(PUBLIC_REMINDER_CHANNEL_ID)).send(PUBLIC_REMINDER_MESSAGE) |
| 76 | + logger.info("Sent public reminder message") |
| 77 | + |
| 78 | +@tasks.loop(seconds=SECONDS_IN_HOUR) # will run again after this time elapses *and* the previous execution has completed |
| 79 | +async def vouch_weekly_message(): |
70 | 80 | seconds_until_next_reminder = SECONDS_IN_WEEK - ((int(time.time()) - int(VOUCH_REMINDER_START)) % SECONDS_IN_WEEK) |
71 | 81 | if seconds_until_next_reminder <= SECONDS_IN_HOUR: |
72 | | - await client.get_channel(int(VOUCH_REMINDER_CHANNEL_ID)).send(WEEKLY_MESSAGE) |
73 | | - logger.info("Sent reminder message") |
| 82 | + await client.get_channel(int(VOUCH_REMINDER_CHANNEL_ID)).send(VOUCH_REMINDER_MESSAGE) |
| 83 | + logger.info("Sent vouch reminder message") |
74 | 84 |
|
75 | 85 | client.run(TOKEN) |
0 commit comments