Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Atul-Kumar-Jena authored Dec 16, 2020
1 parent c39afc9 commit 8e9f4fd
Show file tree
Hide file tree
Showing 98 changed files with 14,644 additions and 0 deletions.
11 changes: 11 additions & 0 deletions userbot/plugins/Binod.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from userbot.utils import admin_cmd

@borg.on(admin_cmd(pattern=r"bid ?(.*)"))
async def bid(event):
giveVar = event.text
bid = giveVar[5]
if not bid:
bid = "😂"
await event.edit(
f"{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n\n{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}\n {bid}{bid}\n {bid}{bid}\n {bid}{bid}\n {bid}{bid}\n {bid}{bid}\n {bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}\n\n{bid}{bid} {bid}{bid}\n{bid}{bid}{bid} {bid}{bid}\n{bid}{bid}{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}{bid}{bid}\n{bid}{bid} {bid}{bid}{bid}\n{bid}{bid} {bid}{bid}\n\n {bid}{bid}{bid}{bid}{bid}\n {bid}{bid}{bid}{bid}{bid}{bid}{bid}\n {bid}{bid} {bid}{bid}\n {bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n {bid}{bid} {bid}{bid}\n {bid}{bid} {bid}{bid}\n {bid}{bid}{bid}{bid}{bid}{bid}{bid}\n {bid}{bid}{bid}{bid}{bid}\n\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid} {bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}{bid}\n{bid}{bid}{bid}{bid}{bid}{bid}{bid}"
)
6 changes: 6 additions & 0 deletions userbot/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from userbot import darkdef


darkmusic = darkdef.darkmusic
darkmusicvideo = darkdef.darkmusicvideo

115 changes: 115 additions & 0 deletions userbot/plugins/_core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import asyncio
import os
from datetime import datetime
from pathlib import Path

from userbot import ALIVE_NAME
from userbot import bot
from userbot.utils import admin_cmd, load_module, remove_plugin, sudo_cmd
from userbot.utils import edit_or_reply as eor

DELETE_TIMEOUT = 5
thumb_image_path = "./Resources/IMG_20201005_150245_168.jpg"
DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "DarkCobra"


@bot.on(admin_cmd(pattern=r"send (?P<shortname>\w+)", outgoing=True))
@bot.on(sudo_cmd(pattern=r"send (?P<shortname>\w+)", allow_sudo=True))
async def send(event):
if event.fwd_from:
return
hmm = bot.uid
message_id = event.message.id
thumb = thumb_image_path
input_str = event.pattern_match.group(1)
the_plugin_file = "./userbot/plugins/{}.py".format(input_str)
if os.path.exists(the_plugin_file):
start = datetime.now()
pro = await event.client.send_file(
event.chat_id,
the_plugin_file,
force_document=True,
allow_cache=False,
thumb=thumb,
reply_to=message_id,
)
end = datetime.now()
time_taken_in_ms = (end - start).seconds
await eor(
pro,
f"**==> Plugin name:** `{input_str}`\n**==> Uploaded in {time_taken_in_ms} seconds only.**\n**==> Uploaded by:** [{DEFAULTUSER}](tg://user?id={hmm})\n",
)
await asyncio.sleep(DELETE_TIMEOUT)
await event.delete()
else:
await eor(event, "**404**: __File Not Found__")


@bot.on(admin_cmd(pattern="install"))
@bot.on(sudo_cmd(pattern="install", allow_sudo=True))
async def install(event):
if event.fwd_from:
return
if event.reply_to_msg_id:
try:
downloaded_file_name = (
await event.client.download_media( # pylint:disable=E0602
await event.get_reply_message(),
"userbot/plugins/", # pylint:disable=E0602
)
)
if "(" not in downloaded_file_name:
path1 = Path(downloaded_file_name)
shortname = path1.stem
load_module(shortname.replace(".py", ""))
await eor(
event,
"Plugin successfully installed\n `{}`".format(
os.path.basename(downloaded_file_name)
),
)
else:
os.remove(downloaded_file_name)
await eor(
event,
"**Error!**\nPlugin cannot be installed!\n Or may have been pre-installed.",
)
except Exception as e: # pylint:disable=C0103,W0703
await eor(event, str(e))
os.remove(downloaded_file_name)
await asyncio.sleep(DELETE_TIMEOUT)
await event.delete()


@bot.on(admin_cmd(pattern=r"unload (?P<shortname>\w+)$"))
@bot.on(sudo_cmd(pattern=r"unload (?P<shortname>\w+)$", allow_sudo=True))
async def unload(event):
if event.fwd_from:
return
shortname = event.pattern_match["shortname"]
try:
remove_plugin(shortname)
qwe = await eor(event, f"DarkCobra Has Successfully unloaded {shortname}")
except Exception as e:
await qwe.edit(
"Darkcobra has Successfully unloaded {shortname}\n{}".format(shortname, str(e))
)


@bot.on(admin_cmd(pattern=r"load (?P<shortname>\w+)$"))
@bot.on(sudo_cmd(pattern=r"load (?P<shortname>\w+)$", allow_sudo=True))
async def load(event):
if event.fwd_from:
return
shortname = event.pattern_match["shortname"]
try:
try:
remove_plugin(shortname)
except BaseException:
pass
load_module(shortname)
qwe = await eor(event, f"Successfully loaded {shortname}")
except Exception as e:
await qwe.edit(
f"DarkCobra could not load {shortname} because of the following error.\n{str(e)}"
)
98 changes: 98 additions & 0 deletions userbot/plugins/_helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
from userbot import CMD_LIST
from userbot import ALIVE_NAME
from userbot.utils import admin_cmd, sudo_cmd
from platform import uname
import sys
from telethon import events, functions, __version__

DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "@Dark_cobra_support_group"

#@command(pattern="^.help ?(.*)")
@borg.on(admin_cmd(pattern=r"help ?(.*)", outgoing=True))
@borg.on(sudo_cmd(pattern=r"help ?(.*)", outgoing=True, allow_sudo=True))
async def cmd_list(event):
if not event.text[0].isalpha() and event.text[0] not in ("/" , "#", "-", "_", "@"):
tgbotusername = Var.TG_BOT_USER_NAME_BF_HER
input_str = event.pattern_match.group(1)
if tgbotusername is None or input_str == "text":
string = ""
for i in CMD_LIST:
string += "⚡️" + i + "\n"
for iter_list in CMD_LIST[i]:
string += " `" + str(iter_list) + "`"
string += "\n"
string += "\n"
if len(string) > 69:
with io.BytesIO(str.encode(string)) as out_file:
out_file.name = "cmd.txt"
await bot.send_file(
event.chat_id,
out_file,
force_document=True,
allow_cache=False,
caption="**COMMANDS** In DARK COBRA",
reply_to=reply_to_id
)
await event.delete()
else:
await event.edit(string)
elif input_str:
if input_str in CMD_LIST:
string = "Commands found in {}:\n".format(input_str)
for i in CMD_LIST[input_str]:
string += " " + i
string += "\n"
await event.edit(string)
else:
await event.edit(input_str + " is not a valid plugin!")
else:
help_string = f"""Userbot Helper.. Provided by ✨{DEFAULTUSER}\n
`Userbot Helper to reveal all the commands`\n__Do .help plugin_name for commands, in case popup doesn't appear.__"""
results = await bot.inline_query( # pylint:disable=E0602
tgbotusername,
help_string
)
await results[0].click(
event.chat_id,
reply_to=event.reply_to_msg_id,
hide_via=True
)
await event.delete()

@borg.on(admin_cmd(pattern="dc")) # pylint:disable=E0602
async def _(event):
if event.fwd_from:
return
result = await borg(functions.help.GetNearestDcRequest()) # pylint:disable=E0602
await event.edit(result.stringify())


@borg.on(admin_cmd(pattern="config")) # pylint:disable=E0602
async def _(event):
if event.fwd_from:
return
result = await borg(functions.help.GetConfigRequest()) # pylint:disable=E0602
result = result.stringify()
logger.info(result) # pylint:disable=E0602
await event.edit("Telethon UserBot powered byDark_cobra")


@borg.on(admin_cmd(pattern="syntax (.*)"))
async def _(event):
if event.fwd_from:
return
plugin_name = event.pattern_match.group(1)

if plugin_name in CMD_LIST:
help_string = CMD_LIST[plugin_name].__doc__
unload_string = f"Use `.unload {plugin_name}` to remove this plugin.\n © Dark Cobra"

if help_string:
plugin_syntax = f"Syntax for plugin **{plugin_name}**:\n\n{help_string}\n{unload_string}"
else:
plugin_syntax = f"No DOCSTRING has been setup for {plugin_name} plugin."
else:

plugin_syntax = "Enter valid **Plugin** name.\nDo `.plinfo` or `.help` to get list of valid plugin names."

await event.edit(plugin_syntax)
36 changes: 36 additions & 0 deletions userbot/plugins/_inlinebot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
Waaah Bc Waaah
Aao ye bhi loot lo bhosdiwalo..
Yahi karo bes tum 😒😒😒😒😒
😑😑😑😑😑😑😑🙃🙃🙃🙃🙃🙃😒😒😒😒😒😒😒🤦🏻‍♂️🤦🏻‍♂️
delete kr diya h _inline
usko alag se install krna padta h beta
😎😎😎😎😎
"""



#gtfo

#getlost

#TEAM DC

#special plugin for Kangers..

# Bhaag bhosdike
Loading

0 comments on commit 8e9f4fd

Please sign in to comment.