-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Chat_base
53 lines (27 loc) · 902 Bytes
/
Chat_base
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) Shrimadhav U K
# the logging things
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
import os
# the secret configuration specific things
if bool(os.environ.get("WEBHOOK", False)):
from sample_config import Config
else:
from config import Config
# the Strings used for this "thing"
from translation import Translation
from pyrogram import Client, Filters
# the Telegram trackings
from chatbase import Message
def TRChatBase(chat_id, message_text, intent):
msg = Message(api_key=Config.CHAT_BASE_TOKEN,
platform="Telegram",
version="1.3",
user_id=chat_id,
message=message_text,
intent=intent)
resp = msg.send()