Co-authored-by: Danish <danish@ultroid.tech> Co-authored-by: Aditya <me@xditya.me> Co-authored-by: Amit Sharma <48654350+buddhhu@users.noreply.github.com> Co-authored-by: sppidy <sppidy@users.noreply.github.com> Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com> Co-authored-by: divkix <divkix@users.noreply.github.com> Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com> Co-authored-by: Programming Error <error@notavailable.live>
47 lines
1.4 KiB
Python
47 lines
1.4 KiB
Python
# Ultroid - UserBot
|
|
# Copyright (C) 2021 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/>.
|
|
|
|
|
|
import aiohttp
|
|
|
|
from . import *
|
|
|
|
|
|
@ultroid_cmd(pattern="echo ?(.*)", type=["manager"])
|
|
async def oqha(e):
|
|
match = e.pattern_match.group(1)
|
|
if match:
|
|
text = match
|
|
reply_to = e
|
|
elif e.is_reply:
|
|
text = (await e.get_reply_message()).text
|
|
reply_to = e.reply_to_msg_id
|
|
else:
|
|
return await eor(e, "What to Echo?", time=5)
|
|
await e.client.send_message(e.chat_id, text, reply_to=reply_to)
|
|
|
|
|
|
@ultroid_cmd(pattern="kickme$", type=["manager"], allow_all=True)
|
|
async def doit(e):
|
|
if e.sender_id in DEVLIST:
|
|
return await eod(e, "`I will Not Kick You, my Developer..`")
|
|
try:
|
|
await e.client.kick_participant(e.chat_id, e.sender_id)
|
|
except Exception as Fe:
|
|
return await eor(e, str(Fe), time=5)
|
|
await eor(e, "Yes, You are right, get out.", time=5)
|
|
|
|
|
|
@ultroid_cmd(pattern="joke$", type=["manager"])
|
|
async def do_joke(e):
|
|
e = await e.get_reply_message() if e.is_reply else e
|
|
link = "https://v2.jokeapi.dev/joke/Any?blacklistFlags=nsfw,religious,political,racist,sexist,explicit&type=single"
|
|
async with aiohttp.ClientSession() as ses:
|
|
async with ses.get(link) as out:
|
|
out = await out.json()
|
|
await e.reply(out["joke"])
|