File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 5
5
from celery import shared_task
6
6
from celery .utils .log import get_task_logger
7
7
8
- from discord import Webhook , Embed
8
+ from discord import SyncWebhook , Embed
9
9
10
10
from .models import Announcement
11
11
from contestsuite .settings import ANNOUNCEMENT_WEBHOOK_URL , DEFAULT_FROM_EMAIL , ALLOWED_HOSTS
@@ -62,9 +62,7 @@ def discord_announcement(id):
62
62
logger .error (f'Failed to fetch announcement with id { id } ' )
63
63
else :
64
64
# Initializing webhook
65
- # webhook = Webhook.from_url(
66
- # ANNOUNCEMENT_WEBHOOK_URL, adapter=RequestsWebhookAdapter())
67
- webhook = Webhook .SyncWebHook .from_url (ANNOUNCEMENT_WEBHOOK_URL )
65
+ webhook = SyncWebhook .from_url (ANNOUNCEMENT_WEBHOOK_URL )
68
66
url = 'https://' + ALLOWED_HOSTS [0 ]+ announcement .get_absolute_url ()
69
67
70
68
if len (announcement .content ) <= 140 :
You can’t perform that action at this time.
0 commit comments