Skip to content

Commit

Permalink
Here We Go Again !
Browse files Browse the repository at this point in the history
  • Loading branch information
Spyderzz committed Dec 20, 2019
1 parent 4de9799 commit ae30f67
Show file tree
Hide file tree
Showing 27 changed files with 988 additions and 42 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ RUN python3 -m ensurepip \
#
# Clone repo and prepare working directory
#
RUN git clone https://github.com/AvinashReddy3108/PaperplaneExtended /root/userbot
RUN git clone https://github.com/Spyderzz/Userbot/root/userbot
RUN mkdir /root/userbot/bin/
WORKDIR /root/userbot/

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<p align="center"><a href="#how-to-host">How To Host</a> | <a href="#credits">Credits</a> | <a href="#license">License</a></p>
<p align="center">&nbsp;</p>
<h2 align="center">How To Host</h2>
<h5 align="center">The easiest way to deploy this derpfest!</h5>
<h5 align="center">The easiest way to deploy this Bad Boi!!!!</h5>
<p align="center"><a href="https://heroku.com/deploy"> <img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku" /></a></p>
<p align="center">&nbsp;</p>
<h2 align="center">Credits</h2>
<p align="center">Huge thanks to <a href="https://github.com/AvinashReddy3108/PaperplaneExtended/graphs/contributors">everyone</a> who have helped make this userbot awesome!!</p>
<p align="center">Huge thanks to <a href="https://github.com/Spyderzz/Userbot/graphs/contributors">everyone</a> who have helped make this userbot awesome!!</p>
<p align="center">&nbsp;</p>
<h2 align="center">License</h2>
<p align="center"><a href="https://github.com/AvinashReddy3108/PaperplaneExtended/blob/master/LICENSE">Raphielscape Public License</a> - Version 1.c, June 2019</p>
<p align="center"><a href="https://github.com/Spyderzz/Userbot/blob/master/LICENSE">Raphielscape Public License</a> - Version 1.c, June 2019</p>
16 changes: 8 additions & 8 deletions userbot/modules/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ async def promote(promt):
try:
await promt.client(
EditAdminRequest(promt.chat_id, user.id, new_rights, rank))
await promt.edit("`Promoted Successfully!`")
await promt.edit("`Promoted Successfully!,Now gib Party`")

# If Telethon spit BadRequestError, assume
# we don't have Promote permission
Expand Down Expand Up @@ -195,7 +195,7 @@ async def demote(dmod):
except BadRequestError:
await dmod.edit(NO_PERM)
return
await dmod.edit("`Demoted Successfully!`")
await dmod.edit("`Demoted Successfully!, GTFO`")

# Announce to the logging group if we have demoted successfully
if BOTLOG:
Expand Down Expand Up @@ -287,15 +287,15 @@ async def nothanos(unbon):
try:
await unbon.client(
EditBannedRequest(unbon.chat_id, user.id, UNBAN_RIGHTS))
await unbon.edit("```Unbanned Successfully```")
await unbon.edit("```Unbanned Successfully ;)```")

if BOTLOG:
await unbon.client.send_message(
BOTLOG_CHATID, "#UNBAN\n"
f"USER: [{user.first_name}](tg://user?id={user.id})\n"
f"CHAT: {unbon.chat.title}(`{unbon.chat_id}`)")
except UserIdInvalidError:
await unbon.edit("`Uh oh my unban logic broke!`")
await unbon.edit("`Uh Oh! My unban logic broke!`")


@register(outgoing=True, pattern="^.mute(?: |$)(.*)", groups_only=True)
Expand Down Expand Up @@ -346,7 +346,7 @@ async def spider(spdr):
if reason:
await spdr.edit(f"`Safely taped !!`\nReason: {reason}")
else:
await spdr.edit("`Safely taped !!`")
await spdr.edit("`Haha! Safely taped !!`")

# Announce to logging group
if BOTLOG:
Expand Down Expand Up @@ -557,7 +557,7 @@ async def rm_deletedacc(show):
await show.edit("`I am not an admin here!`")
return

await show.edit("`Deleting deleted accounts...\nOh I can do that?!?!`")
await show.edit("`Deleting Deleted accounts...`")
del_u = 0
del_a = 0

Expand Down Expand Up @@ -615,7 +615,7 @@ async def get_admin(show):
await show.edit(mentions, parse_mode="html")
except MessageTooLongError:
await show.edit(
"Damn, too many admins here. Uploading admin list as file.")
"Damn, too many Admins here. Uploading Admin list as file.")
file = open("adminlist.txt", "w+")
file.write(mentions)
file.close()
Expand Down Expand Up @@ -780,7 +780,7 @@ async def get_users(show):
await show.edit(mentions)
except MessageTooLongError:
await show.edit(
"Damn, this is a huge group. Uploading users lists as file.")
"Damn, this is a huge af group. Uploading users lists as file.")
file = open("userslist.txt", "w+")
file.write(mentions)
file.close()
Expand Down
2 changes: 1 addition & 1 deletion userbot/modules/afk.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ async def set_afk(afk_e):
await afk_e.edit(f"Going AFK!\
\nReason: `{string}`")
else:
await afk_e.edit("Going AFK!")
await afk_e.edit("Going away from Virtual World !!")
if BOTLOG:
await afk_e.client.send_message(BOTLOG_CHATID, "#AFK\nYou went AFK!")
if afk_db:
Expand Down
61 changes: 61 additions & 0 deletions userbot/modules/create.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#this module original created by @spechide


from telethon.tl import functions, types
from userbot.events import register
from userbot import CMD_HELP


@register(outgoing=True, pattern="^.create (b|g|c)(?: |$)(.*)")
async def telegraphs(grop):
""" For .create command, Creating New Group & Channel """
if not grop.text[0].isalpha() and grop.text[0] not in ("/", "#", "@", "!"):
if grop.fwd_from:
return
type_of_group = grop.pattern_match.group(1)
group_name = grop.pattern_match.group(2)
if type_of_group == "b":
try:
result = await grop.client(functions.messages.CreateChatRequest( # pylint:disable=E0602
users=["@TheShinChan_Bot"],
# Not enough users (to create a chat, for example)
# Telegram, no longer allows creating a chat with ourselves
title=group_name
))
created_chat_id = result.chats[0].id
await grop.client(functions.messages.DeleteChatUserRequest(
chat_id=created_chat_id,
user_id="@TheShinChan_Bot"
))
result = await grop.client(functions.messages.ExportChatInviteRequest(
peer=created_chat_id,
))
await grop.edit("Your `{}` Group bnadia Sar. Join [{}]({})".format(group_name, group_name, result.link))
except Exception as e: # pylint:disable=C0103,W0703
await grop.edit(str(e))
elif type_of_group == "g" or type_of_group == "c":
try:
r = await grop.client(functions.channels.CreateChannelRequest( # pylint:disable=E0602
title=group_name,
about="Welcome to this Channel",
megagroup=False if type_of_group == "c" else True
))
created_chat_id = r.chats[0].id
result = await grop.client(functions.messages.ExportChatInviteRequest(
peer=created_chat_id,
))
await grop.edit("Aapka `{}` Group/Channel banadiya sar. Join [{}]({})".format(group_name, group_name, result.link))
except Exception as e: # pylint:disable=C0103,W0703
await grop.edit(str(e))

CMD_HELP.update({
"create": "\
Create\
\nUsage: Create Channel, Group & Group With Bot.\
\n\n.create g\
\nUsage: Create a Private Group.\
\n\n.create b\
\nUsage: Create a Group with Bot.\
\n\n.create c\
\nUsage: Create a Channel.\
"})
Loading

0 comments on commit ae30f67

Please sign in to comment.