fix(shard): 🚑 Young accounts being able to send messages on call.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user