Skip to content

Update __init__.py #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@


# Blue Moon Vampire Bot
> An Telegram Antispam Based Bot .

## A Pyogram Bot to make banned, report easy
> Based Sylviorus Api
> A Pyrogram UBot to make gbanning easy

## Installing Vars
```
[+] You need to put in config.py:
[-] APP_ID: You can get this value from https://my.telegram.org
[-] APP_HASH : You can get this value from https://my.telegram.org
[-] MONGO_URI : Your Mongo DB DataBase Url. .
[-] BOT_TOKEN: Get from botfarther
[-] SESSION: Get YOUR ID SESSION
[-] SYL_TOKEN: Get from @BlueMoonVampireBot Only Dev
[-] DEVS: Enter Dev Id
[-] LOGS: Log Channel Id
[-] REPORT_LOGS: Log Report Channel Id
[-] GBAN_LOGS: Log GBAN group Id
```

# Deploy
Expand Down
15 changes: 7 additions & 8 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@
"""

from pyrogram import Client
from config import API_ID, API_HASH, BOT_TOKEN, SYLTOKEN
from config import API_ID, API_HASH, SESSION
from .utils import Sylviorus
from .db import LocalDb

bot = Client("Sylviorus",
api_id=API_ID,
api_hash=API_HASH,
bot_token=BOT_TOKEN,
plugins=dict(root="{}/plugins".format(__name__)))

bot = Client(
session_name=SESSION,
api_id=API_ID,
api_hash=API_HASH,
plugins=dict(root="{}/plugins".format(__name__))
)

ldb = LocalDb("reasons")
SYL = Sylviorus(SYLTOKEN)
46 changes: 15 additions & 31 deletions app/plugins/ban.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"""

from app import SYL, bot
from app import app
from config import LOGS, DEVS
from config import LOGS, DEVS, GBAN_LOGS
from app.utils import *
from pyrogram import filters
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
Expand All @@ -32,7 +31,7 @@
from pyrogram.types import Message


@bot.on_message(filters.command("sylban", prefixes=["/", ".", "?", "-"]))
@bot.on_message(filters.command("scan", prefixes=["/", ".", "?", "-"]))
async def ban(Client, m: Message):
if not m.from_user.id in DEVS:
await m.reply_text("Only The Vampire of Blue moon Can Use Me")
Expand All @@ -52,19 +51,13 @@ async def ban(Client, m: Message):

else:
user = int(user)
if user not in DEVS:
x = SYL.ban(user, reason, enforcer)
buttons = [
[
InlineKeyboardButton(
"Support", url="https://t.me/Sylviorus_support")
],
[
InlineKeyboardButton(
"Report", url="https://t.me/SylviorusReport")
],
]

if user not in DEVS:
await bot.send_message(
GBAN_LOGS,
f"""/fban {user} {reason} //by {enforce}""")
await bot.send_message(
GBAN_LOGS,
f"""/gban {user} {reason} //by {enforce}""")
await bot.send_message(
LOGS,
f"""
Expand All @@ -73,9 +66,7 @@ async def ban(Client, m: Message):
**REASON**: {reason}
**ENFORCER**: [{enforcer}](tg://user?id={enforcer})
**CHAT_ID** : {m.chat.id}
""",
reply_markup=InlineKeyboardMarkup(buttons))
await m.reply(x)
""")
else:
await m.reply("Vampires Cant Be Banned!")

Expand All @@ -86,15 +77,10 @@ async def ban(Client, m: Message):

if not user in DEVS:
user = int(user)
buttons = [[
InlineKeyboardButton("Support",
url="https://t.me/Sylviorus_support"),
],
[
InlineKeyboardButton(
"Report", url="https://t.me/SylviorusReport"),
]]
x = SYL.ban(user, reason, enforcer)
await bot.send_message(GBAN_LOGS,
f"""/gban {user} {reason} //by {enforce}""")
await bot.send_message(GBAN_LOGS,
f"""/fban {user} {reason} //by {enforce}""")
await bot.send_message(LOGS,
f"""
#BANNED
Expand All @@ -104,9 +90,7 @@ async def ban(Client, m: Message):
**ENFORCER**: [{enforcer}](tg://user?id={enforcer})
**CHAT_ID** : {m.chat.id}
**Message Link : {m.link}
""",
reply_markup=InlineKeyboardMarkup(buttons))
await m.reply(x)
""")

else:
await m.reply("The Vampire of Blue moon can't be banned!")
71 changes: 0 additions & 71 deletions app/plugins/check.py

This file was deleted.

85 changes: 0 additions & 85 deletions app/plugins/extra.py

This file was deleted.

24 changes: 9 additions & 15 deletions app/plugins/gscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
"""

from app import SYL, bot
from app import app
from app.utils import *
from config import DEVS, LOGS
from config import DEVS, LOGS, GBAN_LOGS
from pyrogram import filters
from pyrogram.errors import FloodWait
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
Expand All @@ -50,17 +49,12 @@ async def gscan(bot: Client, m: Message):
await m.reply("Banning....")
for x in users:
try:
SYL.ban(x, "Mass Adder MSG_ID : {}".format(m.message_id),
m.from_user.id)
buttons = [[
InlineKeyboardButton("Support",
url="https://t.me/Sylviorus_support"),
],
[
InlineKeyboardButton(
"Report",
url="https://t.me/SylviorusReport"),
]]
await bot.send_message(
GBAN_LOGS,
f"""/fban {x} MASS ADDING For @{grp} //by m.from_user.id"""
await bot.send_message(
GBAN_LOGS,
f"""/gban {x} MASS ADDING For @{grp} //by m.from_user.id""")
await bot.send_message(
LOGS,
f"""
Expand All @@ -70,8 +64,8 @@ async def gscan(bot: Client, m: Message):
**REASON**: MASS ADDING For @{grp}
**ENFORCER** : [{m.from_user.id}](tg://user?id={m.from_user.id})
**CHAT_ID** : {m.chat.id}
""",
reply_markup=InlineKeyboardMarkup(buttons))
""")

time.sleep(1)
except Exception as e:
await i.edit(f"{e}")
Expand Down
14 changes: 4 additions & 10 deletions app/plugins/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,18 @@

/start - __Start Mesasage__
/help - __Help Message__
/check userid or reply to user - __Check User__
/setrole - __Roles Name__
/sylreport - __Report Message__
/report - __Report Message__

**Clan Of BlueMoon Commands**:

/sylban userid __reason or reply to user__ - __Ban User__
/sylunban userid - __Unban User__
/scan userid __reason or reply to user__ - __Ban User__
/unscan userid - __Unban User__
/gscan Username - __All Group Admin Ban__
/ungscan Username - __All Group Admin Unban__
"""


@bot.on_message(filters.command("help", ['/', ".", "?"]))
async def help(bot, m):
await m.reply(HELP_TEXT,
parse_mode="markdown",
reply_markup=InlineKeyboardButton([[
InlineKeyboardButton(
"Support", url="https://t.me/sylviorus_support")
]]))
await m.reply(HELP_TEXT)
Loading