Spaces:
Sleeping
Sleeping
File size: 6,470 Bytes
ca4eb6d 3925c05 11ae35a 87abec5 11ae35a 83fe5dc 11ae35a ca4eb6d 11ae35a ca4eb6d 11170eb ca4eb6d 89ad488 ca4eb6d 5ec9c41 ca4eb6d c68d102 ca4eb6d 89ad488 cb4b83b 89ad488 ca4eb6d c68d102 ca4eb6d c68d102 ca4eb6d e1533e7 ca4eb6d cb4b83b 89ad488 ca4eb6d c68d102 ca4eb6d 87abec5 ca4eb6d c68d102 ca4eb6d af1662b ca4eb6d af1662b cb4b83b 53c3c93 cb4b83b ead33cc 83fe5dc ca4eb6d af1662b c68d102 df6003b af1662b 7231326 af1662b 7231326 c11ea2e c6da59f 7231326 af1662b 7231326 af1662b 7231326 c11ea2e c6da59f 7231326 ca4eb6d af1662b ca4eb6d 1e560ad ca4eb6d c68d102 ca4eb6d c68d102 ca4eb6d 11170eb ca4eb6d af1662b 11170eb ca4eb6d 983072a ca4eb6d 9da6fea 709df35 096ee5f 709df35 d5348c6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
from html import escape
from random import choice
from pyrogram import enums
from pyrogram.errors import MessageTooLong
from pyrogram.types import Message
from Powers.bot_class import Gojo
from Powers.supports import get_support_staff
from Powers.utils import extras
from Powers.utils.custom_filters import command
from Powers.utils.extras import NOWYES as NO
from Powers.utils.extras import YESWNO as YES
@Gojo.on_message(command("shout"))
async def fun_shout(_, m: Message):
if len(m.text.split()) == 1:
await m.reply_text(
text="Please check help on how to use this this command.",
quote=True,
)
return
try:
text = " ".join(m.text.split(None, 1)[1])
result = [" ".join(list(text))]
result.extend(
f"{symbol} " + " " * pos + symbol
for pos, symbol in enumerate(text[1:])
)
result = list("\n".join(result))
result[0] = text[0]
result = "".join(result)
msg = "```\n" + result + "```"
await m.reply_text(msg, parse_mode=enums.ParseMode.MARKDOWN)
return
except MessageTooLong as e:
await m.reply_text(f"Error: {e}")
return
@Gojo.on_message(command("runs"))
async def fun_run(_, m: Message):
await m.reply_text(choice(extras.RUN_STRINGS))
return
@Gojo.on_message(command("slap"))
async def fun_slap(c: Gojo, m: Message):
me = await c.get_me()
reply_text = m.reply_to_message.reply_text if m.reply_to_message else m.reply_text
curr_user = escape(m.from_user.first_name)
user = m.reply_to_message.from_user if m.reply_to_message else m.from_user
user_id = user.id
if user_id == me.id:
temp = choice(extras.SLAP_GOJO_TEMPLATES)
else:
temp = choice(extras.SLAP_TEMPLATES)
if user_id != m.from_user.id:
user1 = curr_user
user2 = user.first_name
else:
user1 = me.first_name
user2 = curr_user
item = choice(extras.ITEMS)
hit = choice(extras.HIT)
throw = choice(extras.THROW)
reply = temp.format(user1=user1, user2=user2, item=item, hits=hit, throws=throw)
await reply_text(reply)
return
@Gojo.on_message(command("roll"))
async def fun_roll(_, m: Message):
reply_text = m.reply_to_message.reply_text if m.reply_to_message else m.reply_text
await reply_text(choice(range(1, 7)))
return
@Gojo.on_message(command("toss"))
async def fun_toss(_, m: Message):
reply_text = m.reply_to_message.reply_text if m.reply_to_message else m.reply_text
await reply_text(choice(extras.TOSS))
return
@Gojo.on_message(command("insult"))
async def insult(c: Gojo, m: Message):
if not m.reply_to_message:
await m.reply_text("You want to insult yourself such a foolish person.\nYou are not even worth insulting")
return
user_id = m.reply_to_message.from_user.id
user_first_name = m.reply_to_message.from_user.first_name
if user_id in get_support_staff("dev_level"):
await m.reply_text("Sorry! I can't insult my devs....")
else:
Insult_omp = choice(extras.INSULT_STRINGS)
await m.reply_to_message.reply_text(Insult_omp)
@Gojo.on_message(command("yes"))
async def yesw(c: Gojo, m: Message):
reply_text = m.reply_to_message.reply_text if m.reply_to_message else m.reply_text
rtext = YES[0]
await reply_text(rtext)
return
@Gojo.on_message(command("no"))
async def now(c: Gojo, m: Message):
reply_text = m.reply_to_message.reply_text if m.reply_to_message else m.reply_text
rtext = NO[0]
await reply_text(rtext)
return
@Gojo.on_message(command("shrug"))
async def fun_shrug(_, m: Message):
reply_text = m.reply_to_message.reply_text if m.reply_to_message else m.reply_text
await reply_text(r"¯\_(ツ)_/¯")
return
@Gojo.on_message(command("bluetext"))
async def fun_bluetext(_, m: Message):
reply_text = m.reply_to_message.reply_text if m.reply_to_message else m.reply_text
await reply_text(
"|| /BLUE /TEXT\n/MUST /CLICK\n/I /AM /A /STUPID /ANIMAL /THAT /IS /ATTRACTED /TO /COLORS ||",
)
return
@Gojo.on_message(command("decide"))
async def fun_decide(_, m: Message):
reply_text = m.reply_to_message.reply_text if m.reply_to_message else m.reply_text
await reply_text(choice(extras.DECIDE))
return
@Gojo.on_message(command("react"))
async def fun_table(_, m: Message):
reply_text = m.reply_to_message.reply_text if m.reply_to_message else m.reply_text
await reply_text(choice(extras.REACTIONS))
return
@Gojo.on_message(command("weebify"))
async def weebify(_, m: Message):
if len(m.text.split()) >= 2:
args = m.text.split(None, 1)[1]
elif m.reply_to_message and len(m.text.split()) == 1:
args = m.reply_to_message.text
else:
await m.reply_text(
"Please reply to a message or enter text after command to weebify it.",
)
return
if not args:
await m.reply_text(text="What am I supposed to Weebify?")
return
# Use split to convert to list
# Not using list itself becuase black changes it to long format...
normiefont = "a b c d e f g h i j k l m n o p q r s t u v w x y z".split()
weebyfont = "卂 乃 匚 刀 乇 下 厶 卄 工 丁 长 乚 从 𠘨 口 尸 㔿 尺 丂 丅 凵 リ 山 乂 丫 乙".split()
string = " ".join(args).lower()
for normiecharacter in string:
if normiecharacter in normiefont:
weebycharacter = weebyfont[normiefont.index(normiecharacter)]
string = string.replace(normiecharacter, weebycharacter)
await m.reply_text(
text=f"""<b>Weebified String:</b>
<code>{string}</code>"""
)
return
__PLUGIN__ = "fun"
_DISABLE_CMDS_ = [
"weebify",
"decide",
"react",
"bluetext",
"toss",
"yes",
"no",
"roll",
"slap",
"runs",
"shout",
"insult",
"shrug",
]
__HELP__ = """
**Fun**
• /runs: reply a random string from an array of replies.
• /slap: slap a user, or get slapped if not a reply.
• /insult: to insult a user, or get insulted if not a reply
• /shrug : get shrug XD.
• /decide : Randomly answers yes/no/maybe
• /toss : Tosses A coin
• /yes : check urself :V
• /no : check urself :V
• /bluetext : check urself :V
• /roll : Roll a dice.
• /react : Random Reaction
• /shout `<keyword>`: write anything you want to give loud shout."""
|