-
-
Notifications
You must be signed in to change notification settings - Fork 302
/
activitygen.py
31 lines (26 loc) · 950 Bytes
/
activitygen.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
# Ultroid - UserBot
# Copyright (C) 2020 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
"""
✘ Commands Available -
• `{i}bored`
Get some activity to do when you get bored
"""
from . import async_searcher, ultroid_cmd
@ultroid_cmd(pattern="bored$")
async def bored_cmd(event):
msg = await event.eor("`Generating an Activity for You!`")
content = await async_searcher(
"https://www.boredapi.com/api/activity", re_json=True
)
m = f"**Activity:** `{content['activity']}`"
if content.get("link"):
m += f"**Read More:** {content['link']}"
if content.get("participants"):
m += f"\n**Participants Required:** `{content['participants']}`"
if content.get("price"):
m += f"\n**Price:** `{content['price']}`"
await msg.edit(m)