Бот для капчи в чатах
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{% extends "base.html" %}
{% block title %}Сообщения - {{ chat.title or chat.chat_id }}{% endblock %}
{% block header %}Сообщения{% endblock %}
{% block content %}
 
<a href="/chats/{{ chat.chat_id }}" class="inline-flex items-center gap-1 text-sm text-brand-600 hover:underline dark:text-brand-400">
    ← Назад к чату
</a>
 
<div class="text-sm text-gray-500">{{ chat.title or chat.chat_id }} (id {{ chat.chat_id }})</div>
 
<section class="overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm dark:border-gray-800 dark:bg-gray-900">
    <div class="max-h-[60vh] divide-y divide-gray-100 overflow-y-auto dark:divide-gray-800">
        {% for m in msgs %}
        <div class="px-4 py-2 text-sm">
            <div class="flex flex-wrap items-center justify-between gap-2">
                <span class="font-medium {% if m.name and m.name.startswith('Amadeus') %}text-brand-600 dark:text-brand-400{% endif %}">{{ m.name }}</span>
                <span class="text-xs text-gray-400">{{ fmt_dt(m.created_at) }}</span>
            </div>
            <div class="mt-0.5 whitespace-pre-wrap break-words">{{ m.text }}</div>
        </div>
        {% else %}
        <div class="px-4 py-8 text-center text-gray-500">Сообщений пока нет.</div>
        {% endfor %}
    </div>
</section>
 
<section class="rounded-xl border border-gray-200 bg-white p-4 shadow-sm dark:border-gray-800 dark:bg-gray-900">
    <form method="post" action="/chats/say" class="space-y-3">
        <input type="hidden" name="chat_id" value="{{ chat.chat_id }}">
        <textarea name="text" rows="3" required placeholder="Написать в чат от имени Амадеуса..."
                  class="w-full rounded-lg border border-gray-300 bg-transparent px-3 py-2 text-sm dark:border-gray-700"></textarea>
        <button class="w-full rounded-lg bg-brand-600 px-4 py-2.5 text-sm font-medium text-white hover:bg-brand-700 sm:w-auto">Отправить</button>
    </form>
    <p class="mt-2 text-xs text-gray-500">Амадеус отправит сообщение с пометкой «От &lt;ваше имя&gt;».</p>
</section>
 
{% endblock %}