Add barebones to better tgbot
Also send tg spam from ohlhafv challenges!
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
Uusi Ohlhafv haaste!
|
||||
====================
|
||||
Haastaja: {{ challenge.challenger }}
|
||||
Uhri: {{ challenge.victim }}
|
||||
Sarja: {{ challenge.get_series_display }}
|
||||
Terveiset: {{ challenge.message }}
|
||||
|
||||
Käy kurkkaamassa muutkin haasteet osoitteessa: {{ url }}
|
||||
@@ -19,6 +19,7 @@ from ohlhafv.models import OhlhafvChallenge
|
||||
from ohlhafv.forms import OhlhafvForm
|
||||
from ohlhafv.tables import OhlhafvTable
|
||||
from webapp.utils import send_email
|
||||
from kaehmy.tgbot import TelegramBot
|
||||
|
||||
|
||||
@require_http_methods(["GET"])
|
||||
@@ -48,6 +49,13 @@ def ohlhafv_submit(request, *args, **kwargs):
|
||||
}
|
||||
)
|
||||
send_email(email, subject, message)
|
||||
|
||||
tg_message = render_to_string(
|
||||
'ohlhafv:tgmsg.tpl', {
|
||||
'challenge': challenge,
|
||||
'url': url})
|
||||
bot = TelegramBot()
|
||||
bot.broadcast(tg_message)
|
||||
logging.debug(
|
||||
'Sent ohlhafv email to recipient <{}>'.format(email))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user