fix(shard): 🚑 Young accounts being able to send messages on call.

This commit is contained in:
2025-05-25 23:33:37 -03:00
parent 1d915a0818
commit da865b105a
+8 -1
View File
@@ -1,3 +1,5 @@
from datetime import datetime, timedelta, timezone
import asyncio
import random
@@ -12,7 +14,7 @@ import sentry_sdk
from payphone.db import models
from payphone.bot import Payphone
from payphone.cogs import base
from payphone.core import constants, censorship, messages, masks, checks, formatting
from payphone.core import constants, censorship, messages, masks, checks, formatting, exceptions
class Calls(base.Cog):
@@ -235,6 +237,11 @@ class Calls(base.Cog):
Handle messages in calls.
"""
if ctx.author.created_at > datetime.now(timezone.utc) - timedelta(
days=exceptions.AccountTooYoungError.days
):
raise exceptions.AccountTooYoungError()
if not isinstance(message.channel, (discord.channel.TextChannel)):
return