Spaces:
Paused
Paused
Captain Ezio
commited on
Commit
Β·
d7366b6
1
Parent(s):
ba59835
minor changes
Browse files- Powers/plugins/bans.py +2 -2
- Powers/plugins/muting.py +2 -2
- Powers/plugins/stickers.py +9 -2
- Powers/plugins/warns.py +6 -4
- Powers/utils/sticker_help.py +3 -3
Powers/plugins/bans.py
CHANGED
|
@@ -96,7 +96,7 @@ async def tban_usr(c: Gojo, m: Message):
|
|
| 96 |
else:
|
| 97 |
txt += "\n<b>Reason</b>: Not Specified"
|
| 98 |
if time_val:
|
| 99 |
-
txt += f"\n<b>Banned
|
| 100 |
keyboard = InlineKeyboardMarkup(
|
| 101 |
[
|
| 102 |
[
|
|
@@ -313,7 +313,7 @@ async def dtban_usr(c: Gojo, m: Message):
|
|
| 313 |
txt += "\n<b>Reason</b>: Not Specified"
|
| 314 |
|
| 315 |
if bantime:
|
| 316 |
-
txt += f"\n<b>Banned
|
| 317 |
keyboard = InlineKeyboardMarkup(
|
| 318 |
[
|
| 319 |
[
|
|
|
|
| 96 |
else:
|
| 97 |
txt += "\n<b>Reason</b>: Not Specified"
|
| 98 |
if time_val:
|
| 99 |
+
txt += f"\n<b>Banned for</b>:{time_val}"
|
| 100 |
keyboard = InlineKeyboardMarkup(
|
| 101 |
[
|
| 102 |
[
|
|
|
|
| 313 |
txt += "\n<b>Reason</b>: Not Specified"
|
| 314 |
|
| 315 |
if bantime:
|
| 316 |
+
txt += f"\n<b>Banned for</b>: {time_val}"
|
| 317 |
keyboard = InlineKeyboardMarkup(
|
| 318 |
[
|
| 319 |
[
|
Powers/plugins/muting.py
CHANGED
|
@@ -93,7 +93,7 @@ async def tmute_usr(c: Gojo, m: Message):
|
|
| 93 |
else:
|
| 94 |
txt += "\n<b>Reason</b>: Not Specified"
|
| 95 |
if mutetime:
|
| 96 |
-
txt += f"\n<b>Muted
|
| 97 |
keyboard = InlineKeyboardMarkup(
|
| 98 |
[
|
| 99 |
[
|
|
@@ -206,7 +206,7 @@ async def dtmute_usr(c: Gojo, m: Message):
|
|
| 206 |
else:
|
| 207 |
txt += "\n<b>Reason</b>: Not Specified"
|
| 208 |
if mutetime:
|
| 209 |
-
txt += f"\n<b>Muted
|
| 210 |
keyboard = InlineKeyboardMarkup(
|
| 211 |
[
|
| 212 |
[
|
|
|
|
| 93 |
else:
|
| 94 |
txt += "\n<b>Reason</b>: Not Specified"
|
| 95 |
if mutetime:
|
| 96 |
+
txt += f"\n<b>Muted for</b>: {time_val}"
|
| 97 |
keyboard = InlineKeyboardMarkup(
|
| 98 |
[
|
| 99 |
[
|
|
|
|
| 206 |
else:
|
| 207 |
txt += "\n<b>Reason</b>: Not Specified"
|
| 208 |
if mutetime:
|
| 209 |
+
txt += f"\n<b>Muted for</b>: {time_val}"
|
| 210 |
keyboard = InlineKeyboardMarkup(
|
| 211 |
[
|
| 212 |
[
|
Powers/plugins/stickers.py
CHANGED
|
@@ -226,7 +226,7 @@ async def kang(c:Gojo, m: Message):
|
|
| 226 |
return
|
| 227 |
|
| 228 |
|
| 229 |
-
@Gojo.on_message(command("mmf"))
|
| 230 |
async def memify_it(c: Gojo, m: Message):
|
| 231 |
if not m.reply_to_message:
|
| 232 |
await m.reply_text("Invalid type.")
|
|
@@ -248,6 +248,11 @@ async def memify_it(c: Gojo, m: Message):
|
|
| 248 |
if len(m.command) == 1:
|
| 249 |
await m.reply_text("Give me something to write")
|
| 250 |
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 251 |
x = await m.reply_text("Memifying...")
|
| 252 |
meme = m.text.split(None,1)[1].strip()
|
| 253 |
name = f"@memesofdank_{m.id}.png"
|
|
@@ -255,7 +260,7 @@ async def memify_it(c: Gojo, m: Message):
|
|
| 255 |
is_sticker = False
|
| 256 |
if rep_to.sticker:
|
| 257 |
is_sticker = True
|
| 258 |
-
output = await draw_meme(path,meme,is_sticker)
|
| 259 |
await x.delete()
|
| 260 |
xNx = await m.reply_photo(output[0],reply_markup=kb)
|
| 261 |
await xNx.reply_sticker(output[1],reply_markup=kb)
|
|
@@ -313,6 +318,8 @@ __HELP__ = """
|
|
| 313 |
β /mmf Hello freinds : this will add text to the top
|
| 314 |
β /mmf Hello ; freinds : this will add Hello to the top and freinds at the bottom
|
| 315 |
β /mmf ; Hello friends : this will add text at the bottom
|
|
|
|
|
|
|
| 316 |
|
| 317 |
**Note**
|
| 318 |
mmf and getsticker only support photo and normal stickers for now.
|
|
|
|
| 226 |
return
|
| 227 |
|
| 228 |
|
| 229 |
+
@Gojo.on_message(command(["mmfb","mmfw","mmf"]))
|
| 230 |
async def memify_it(c: Gojo, m: Message):
|
| 231 |
if not m.reply_to_message:
|
| 232 |
await m.reply_text("Invalid type.")
|
|
|
|
| 248 |
if len(m.command) == 1:
|
| 249 |
await m.reply_text("Give me something to write")
|
| 250 |
return
|
| 251 |
+
filll = m.command[0][-1]
|
| 252 |
+
if filll == "b":
|
| 253 |
+
fiil = "black"
|
| 254 |
+
else:
|
| 255 |
+
fiil = "white"
|
| 256 |
x = await m.reply_text("Memifying...")
|
| 257 |
meme = m.text.split(None,1)[1].strip()
|
| 258 |
name = f"@memesofdank_{m.id}.png"
|
|
|
|
| 260 |
is_sticker = False
|
| 261 |
if rep_to.sticker:
|
| 262 |
is_sticker = True
|
| 263 |
+
output = await draw_meme(path,meme,is_sticker,fiil)
|
| 264 |
await x.delete()
|
| 265 |
xNx = await m.reply_photo(output[0],reply_markup=kb)
|
| 266 |
await xNx.reply_sticker(output[1],reply_markup=kb)
|
|
|
|
| 318 |
β /mmf Hello freinds : this will add text to the top
|
| 319 |
β /mmf Hello ; freinds : this will add Hello to the top and freinds at the bottom
|
| 320 |
β /mmf ; Hello friends : this will add text at the bottom
|
| 321 |
+
β /mmfb <text>: To fill text with black colour
|
| 322 |
+
β /mmfw or /mmf <text>: To fill it with white colour
|
| 323 |
|
| 324 |
**Note**
|
| 325 |
mmf and getsticker only support photo and normal stickers for now.
|
Powers/plugins/warns.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from
|
| 2 |
|
| 3 |
from pyrogram import filters
|
| 4 |
from pyrogram.errors import RPCError
|
|
@@ -6,7 +6,7 @@ from pyrogram.types import (CallbackQuery, ChatPermissions,
|
|
| 6 |
InlineKeyboardButton, InlineKeyboardMarkup,
|
| 7 |
Message)
|
| 8 |
|
| 9 |
-
from Powers import LOGGER, SUPPORT_STAFF
|
| 10 |
from Powers.bot_class import Gojo
|
| 11 |
from Powers.database.rules_db import Rules
|
| 12 |
from Powers.database.users_db import Users
|
|
@@ -71,8 +71,9 @@ async def warn(c: Gojo, m: Message):
|
|
| 71 |
_, num = warn_db.warn_user(user_id, reason)
|
| 72 |
warn_settings = warn_settings_db.get_warnings_settings()
|
| 73 |
if num >= warn_settings["warn_limit"]:
|
|
|
|
| 74 |
if warn_settings["warn_mode"] == "kick":
|
| 75 |
-
await m.chat.ban_member(user_id, until_date=
|
| 76 |
action = "kicked"
|
| 77 |
elif warn_settings["warn_mode"] == "ban":
|
| 78 |
await m.chat.ban_member(user_id)
|
|
@@ -294,7 +295,8 @@ async def remove_last_warn_btn(c: Gojo, q: CallbackQuery):
|
|
| 294 |
)
|
| 295 |
if action == "kick":
|
| 296 |
try:
|
| 297 |
-
|
|
|
|
| 298 |
await q.message.edit_text(
|
| 299 |
(
|
| 300 |
f"Admin {(await mention_html(q.from_user.first_name, q.from_user.id))} "
|
|
|
|
| 1 |
+
from datetime import datetime, timedelta
|
| 2 |
|
| 3 |
from pyrogram import filters
|
| 4 |
from pyrogram.errors import RPCError
|
|
|
|
| 6 |
InlineKeyboardButton, InlineKeyboardMarkup,
|
| 7 |
Message)
|
| 8 |
|
| 9 |
+
from Powers import LOGGER, SUPPORT_STAFF, TIME_ZONE
|
| 10 |
from Powers.bot_class import Gojo
|
| 11 |
from Powers.database.rules_db import Rules
|
| 12 |
from Powers.database.users_db import Users
|
|
|
|
| 71 |
_, num = warn_db.warn_user(user_id, reason)
|
| 72 |
warn_settings = warn_settings_db.get_warnings_settings()
|
| 73 |
if num >= warn_settings["warn_limit"]:
|
| 74 |
+
timeee = datetime.now(TIME_ZONE) + timedelta(minutes=45)
|
| 75 |
if warn_settings["warn_mode"] == "kick":
|
| 76 |
+
await m.chat.ban_member(user_id, until_date=timeee)
|
| 77 |
action = "kicked"
|
| 78 |
elif warn_settings["warn_mode"] == "ban":
|
| 79 |
await m.chat.ban_member(user_id)
|
|
|
|
| 295 |
)
|
| 296 |
if action == "kick":
|
| 297 |
try:
|
| 298 |
+
timee = timeee = datetime.now(TIME_ZONE) + timedelta(minutes=45)
|
| 299 |
+
await c.ban_chat_member(chat_id, user_id, until_date=timee)
|
| 300 |
await q.message.edit_text(
|
| 301 |
(
|
| 302 |
f"Admin {(await mention_html(q.from_user.first_name, q.from_user.id))} "
|
Powers/utils/sticker_help.py
CHANGED
|
@@ -136,7 +136,7 @@ async def get_document_from_file_id(
|
|
| 136 |
)
|
| 137 |
|
| 138 |
|
| 139 |
-
async def draw_meme(image_path: str, text: str, sticker: bool) -> list:
|
| 140 |
_split = text.split(";", 1)
|
| 141 |
if len(_split) == 2:
|
| 142 |
lower_text = _split[1]
|
|
@@ -159,8 +159,8 @@ async def draw_meme(image_path: str, text: str, sticker: bool) -> list:
|
|
| 159 |
upper_text_position = ((width - upper_text_width) // 2, height // 10)
|
| 160 |
lower_text_position = ((width - lower_text_width) // 2, height - lower_text_height - (height // 10))
|
| 161 |
|
| 162 |
-
draw.text(upper_text_position, upper_text, font=font, fill=
|
| 163 |
-
draw.text(lower_text_position, lower_text, font=font, fill=
|
| 164 |
|
| 165 |
if sticker:
|
| 166 |
stick_path = image_path
|
|
|
|
| 136 |
)
|
| 137 |
|
| 138 |
|
| 139 |
+
async def draw_meme(image_path: str, text: str, sticker: bool, fiill: str) -> list:
|
| 140 |
_split = text.split(";", 1)
|
| 141 |
if len(_split) == 2:
|
| 142 |
lower_text = _split[1]
|
|
|
|
| 159 |
upper_text_position = ((width - upper_text_width) // 2, height // 10)
|
| 160 |
lower_text_position = ((width - lower_text_width) // 2, height - lower_text_height - (height // 10))
|
| 161 |
|
| 162 |
+
draw.text(upper_text_position, upper_text, font=font, fill=fiill)
|
| 163 |
+
draw.text(lower_text_position, lower_text, font=font, fill=fiill)
|
| 164 |
|
| 165 |
if sticker:
|
| 166 |
stick_path = image_path
|