diff options
| author | 2018-06-02 16:25:15 +0100 | |
|---|---|---|
| committer | 2018-06-02 16:25:15 +0100 | |
| commit | cdc5e46e432b9109c0fee83821dbd7fd4ae57ee0 (patch) | |
| tree | 139930de49fcd44c7edfd5ed93047f8a3a821de3 | |
| parent | [Wiki] Codeblocks should no longer be way too wide on mobile (diff) | |
[Jams] Send signup messages to jam log channel
| -rw-r--r-- | pysite/constants.py | 1 | ||||
| -rw-r--r-- | pysite/views/main/jams/join.py | 15 | 
2 files changed, 15 insertions, 1 deletions
| diff --git a/pysite/constants.py b/pysite/constants.py index 0099c946..806a6430 100644 --- a/pysite/constants.py +++ b/pysite/constants.py @@ -129,3 +129,4 @@ RMQ_PORT = 5672  # Channels  CHANNEL_MOD_LOG = 282638479504965634  CHANNEL_DEV_LOGS = 409308876241108992 +CHANNEL_JAM_LOGS = 452486310121439262 diff --git a/pysite/views/main/jams/join.py b/pysite/views/main/jams/join.py index 546a0444..47117f21 100644 --- a/pysite/views/main/jams/join.py +++ b/pysite/views/main/jams/join.py @@ -1,10 +1,11 @@ +import datetime  from email.utils import parseaddr  from flask import redirect, request, url_for  from werkzeug.exceptions import BadRequest, NotFound  from pysite.base_route import RouteView -from pysite.constants import BotEventTypes +from pysite.constants import BotEventTypes, CHANNEL_JAM_LOGS  from pysite.decorators import csrf  from pysite.mixins import DBMixin, OAuthMixin, RMQMixin @@ -232,3 +233,15 @@ class JamsJoinView(RouteView, DBMixin, OAuthMixin, RMQMixin):                             f"({username}#{discriminator})"              }          ) + +        self.rmq_bot_event( +            BotEventTypes.send_embed, +            { +                "target": CHANNEL_JAM_LOGS, +                "title": "Code Jams: Applications", +                "message": f"Successful code jam signup from user: {user_id} " +                           f"({username}#{discriminator})", +                "colour": 0x2ecc71,  # Green from d.py +                "timestamp": datetime.datetime.now().isoformat() +            } +        ) | 
