377async def mute_chat(mute_e):
378 from userbot.database.mongo import cli
379 cli = cli["Userbot"]["mute_chat"]
380 """ For .mutechat command, mute any chat. """381 await mute_e.edit(str(mute_e.chat_id))
382 cli.insert_one({"chat_id": mute_e.chat_id})
383 user = await get_user_from_id(mute_e.sender_id, mute_e)
11from userbot import bot
12from userbot.util import admin_cmd
13
14"""Type `.count` and see Magic.""" 15
16
17@bot.on(admin_cmd(pattern='count'))
42 await event.edit("Uploaded to {} in {} seconds.".format(media_urls[0], ms))
43 else:
44 await event.edit("Reply to a message to get a permanent telegra.ph link. (Inspired by @ControllerBot)")
45""" The below lines copied from https://github.com/python273/telegraph/blob/master/telegraph/upload.py 46"""
47
48
116 hours = math.floor(minutes_remaining / 60)
117 minutes = math.floor(minutes_remaining % 60)
118
119 """ - Current - """120 App = result['apps']
121 try:
122 App[0]['quota_used']
268 await dyno.respond(
269 "`[HEROKU]`\n"
270 f"Build: ⬢**{build.app.name}** `Stopped...`")
271 """ - Restart main if builds cancelled - """272 try:
273 app.dynos()[0].restart()
274 except IndexError:
The string statement has not been assigned to anything. This is pointless and should be removed if not necessary. In case this is supposed to describe what's happening in the code, it is recommended to use comments or docstrings instead.
'Define a function to add 2 numbers here.'
def add(a, b):
return a + b
Use Comments:
# Define a function to add 2 numbers here.
def add(a, b):
return a + b
or, use docstrings:
def add(a, b):
'''Function to add 2 numbers here.'''
return a + b