-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
172 lines (139 loc) · 4.75 KB
/
main.py
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# © @riz4d
import requests as req
from pyrogram import *
from Config import *
from constant import base_url,type_url,help_msg
def base():
ur_req=req.get(base_url)
url_js=ur_req.json()
global activity
activity=str(url_js['activity'])
activity_type=str(url_js['type'])
participants=str(url_js['participants'])
global result
result='Category : '+activity_type+'\n\nActivity : `'+activity+'`'
def education():
cat='education'
url=type_url+cat
url_req=req.get(url)
url_json=url_req.json()
global var_education
var_education=str('**Category : '+cat+'**\n\n`'+url_json['activity']+'`')
def recreational():
cat='recreational'
url=type_url+cat
url_req=req.get(url)
url_json=url_req.json()
global var_recreational
var_recreational=str('**Category : '+cat+'**\n\n`'+url_json['activity']+'`')
def social():
cat='social'
url=type_url+cat
url_req=req.get(url)
url_json=url_req.json()
global var_social
var_social=str('**Category : '+cat+'**\n\n`'+url_json['activity']+'`')
def diy():
cat='diy'
url=type_url+cat
url_req=req.get(url)
url_json=url_req.json()
global var_diy
var_diy=str('**Category : '+cat+'**\n\n`'+url_json['activity']+'`')
def charity():
cat='charity'
url=type_url+cat
url_req=req.get(url)
url_json=url_req.json()
global var_charity
var_charity=str('**Category : '+cat+'**\n\n`'+url_json['activity']+'`')
def cooking():
cat='cooking'
url=type_url+cat
url_req=req.get(url)
url_json=url_req.json()
global var_cooking
var_cooking=str('**Category : '+cat+'**\n\n`'+url_json['activity']+'`')
def relaxation():
cat='relaxation'
url=type_url+cat
url_req=req.get(url)
url_json=url_req.json()
global var_relaxation
var_relaxation=str('**Category : '+cat+'**\n\n`'+url_json['activity']+'`')
def music():
cat='music'
url=type_url+cat
url_req=req.get(url)
url_json=url_req.json()
global var_music
var_music=str('**Category : '+cat+'**\n\n`'+url_json['activity']+'`')
def busywork():
cat='busywork'
url=type_url+cat
url_req=req.get(url)
url_json=url_req.json()
global var_busywork
var_busywork=str('**Category : '+cat+'**\n\n`'+url_json['activity']+'`')
app=Client('find-a-hoby',
api_id=API_ID,
api_hash=API_HASH,
bot_token=BOT_TOKEN)
@app.on_message(filters.command('start'))
async def start_msg(client,message):
await message.reply('__Hey **'+message.from_user.first_name+'**🙋🏻♀️__')
await message.reply("__I'm [Hoby Bot](https://github.com/riz4d/Hoby-Bot)\n\n**Purpose** \n\nI can find a hoby for you while you're bored or ....__")
await message.reply(" - /help :- __help menu__\n - /source :- __source code__")
@app.on_message(filters.command('random'))
async def random_msg(client,message):
base()
await message.reply('**'+result+'**')
@app.on_message(filters.command('help'))
async def random_msg(client,message):
await message.reply(help_msg)
@app.on_message(filters.command('source'))
async def random_msg(client,message):
await message.reply("Source Code : [Github Repo](https://github.com/riz4d/Hoby-Bot)")
@app.on_message(filters.command('education'))
async def edu_msg(client,message):
education()
await message.reply(var_education)
@app.on_message(filters.command('recreational'))
async def rec_msg(client,message):
recreational()
await message.reply(var_recreational)
@app.on_message(filters.command('social'))
async def soc_msg(client,message):
social()
await message.reply(var_social)
@app.on_message(filters.command('diy'))
async def diy_msg(client,message):
diy()
await message.reply(var_diy)
@app.on_message(filters.command('charity'))
async def char_msg(client,message):
charity()
await message.reply(var_charity)
@app.on_message(filters.command('cooking'))
async def cook_msg(client,message):
cooking()
await message.reply(var_cooking)
@app.on_message(filters.command('relaxation'))
async def rela_msg(client,message):
relaxation()
await message.reply(var_relaxation)
@app.on_message(filters.command('music'))
async def misc_msg(client,message):
music()
await message.reply(var_music)
@app.on_message(filters.command('busywork'))
async def bcwrk_msg(client,message):
busywork()
await message.reply(var_busywork)
@app.on_message(filters.text)
async def othr_msg(client,message):
if message.text=='rizad':
await message.reply('[@riz4d](https://t.me/riz4d) ,He is my master')
else:
await message.reply("**__I think u don't know to operate me\n\n see help menu by using \n -**__ /help")
app.run()