Beispiel #1
0
 × /setme <teks>: Akan mengatur bio Anda
 × /me: Akan mendapatkan bio Anda atau pengguna lain

Contoh pengaturan bio untuk diri Anda sendiri:
`/setme Saya bekerja untuk Telegram`; Bio diatur untuk diri Anda sendiri.

Contoh penulisan biodata orang lain:
Balas pesan pengguna: `/setbio Dia orang yang keren`.

*Perhatian:* Jangan gunakan /setbio untuk melawan diri sendiri!
"""

__mod_name__ = "Bio/Tentang"

SET_BIO_HANDLER = DisableAbleCommandHandler("setbio",
                                            set_about_bio,
                                            run_async=True)
GET_BIO_HANDLER = DisableAbleCommandHandler("bio",
                                            about_bio,
                                            pass_args=True,
                                            run_async=True)

SET_ABOUT_HANDLER = DisableAbleCommandHandler("setme",
                                              set_about_me,
                                              run_async=True)
GET_ABOUT_HANDLER = DisableAbleCommandHandler("me",
                                              about_me,
                                              pass_args=True,
                                              run_async=True)

dispatcher.add_handler(SET_BIO_HANDLER)
Beispiel #2
0
        "{}".format(reply),
        parse_mode=ParseMode.MARKDOWN,
        disable_web_page_preview=True,
    )
    time.sleep(30)
    try:
        del_msg.delete()
        update.effective_message.delete()
    except BadRequest as err:
        if (err.message == "Message to delete not found") or (
                err.message == "Message can't be deleted"):
            return


__help__ = """
Weather module:

 × /weather <city>: Gets weather information of particular place!

 \* To prevent spams weather command and the output will be deleted after 30 seconds
"""

__mod_name__ = "Weather"

WEATHER_HANDLER = DisableAbleCommandHandler("weather",
                                            weather,
                                            pass_args=True,
                                            run_async=True)

dispatcher.add_handler(WEATHER_HANDLER)
Beispiel #3
0
            return


def __gdpr__(user_id):
    afk_db.rm_afk(user_id)


__help__ = """
When marked as AFK, any mentions will be replied to with a message to say you're not available!

 × /afk <reason>: Mark yourself as AFK.
 × brb <reason>: Same as the afk command - but not a command.
"""


AFK_HANDLER = DisableAbleCommandHandler("afk", afk, run_async=True)
AFK_REGEX_HANDLER = DisableAbleMessageHandler(
    Filters.regex("(?i)brb"), afk, friendly="afk", run_async=True
)
NO_AFK_HANDLER = MessageHandler(
    Filters.all, no_longer_afk, run_async=True
)
AFK_REPLY_HANDLER = MessageHandler(
    Filters.all & Filters.chat_type.groups & ~Filters.update.edited_message,
    reply_afk,
    run_async=True,
)


dispatcher.add_handler(AFK_HANDLER, AFK_GROUP)
dispatcher.add_handler(AFK_REGEX_HANDLER, AFK_GROUP)
Beispiel #4
0
    ["resetwarn", "resetwarns"],
    reset_warns,
    pass_args=True,
    filters=Filters.chat_type.groups,
    run_async=True,
)
REMOVE_WARNS_HANDLER = CommandHandler(
    ["rmwarn", "unwarn"],
    remove_warns,
    pass_args=True,
    filters=Filters.chat_type.groups,
    run_async=True,
)
CALLBACK_QUERY_HANDLER = CallbackQueryHandler(button, pattern=r"rm_warn")
MYWARNS_HANDLER = DisableAbleCommandHandler("warns",
                                            warns,
                                            pass_args=True,
                                            run_async=True)
ADD_WARN_HANDLER = CommandHandler("addwarn", add_warn_filter, run_async=True)
RM_WARN_HANDLER = CommandHandler(["nowarn", "stopwarn"],
                                 remove_warn_filter,
                                 run_async=True)
LIST_WARN_HANDLER = DisableAbleCommandHandler(
    ["warnlist", "warnfilters"],
    list_warn_filters,
    admin_ok=True,
    run_async=True,
)
WARN_FILTER_HANDLER = MessageHandler(CustomFilters.has_text
                                     & Filters.chat_type.groups,
                                     reply_filter,
                                     run_async=True)
Beispiel #5
0
            suggestions = change.get("Suggestions")
            if suggestions:
                # should look at this list more
                sugg_str = suggestions[0].get("Text")
                curr_string += msg.text[prev_end:start] + sugg_str
                prev_end = end

        curr_string += msg.text[prev_end:]
        update.effective_message.reply_text(curr_string)
    else:
        update.effective_message.reply_text(
            "Reply to some message to get grammar corrected text!")


__help__ = """
× /tr or /tl: - To translate to your language, by default language is set to english, use `/tr <lang code>` for some other language!
× /spell: - As a reply to get grammar corrected text of gibberish message.
× /tts: - To some message to convert it into audio format!
"""
__mod_name__ = "Translate"

dispatcher.add_handler(
    DisableAbleCommandHandler(["tr", "tl"],
                              gtrans,
                              pass_args=True,
                              run_async=True))
dispatcher.add_handler(
    DisableAbleCommandHandler("tts", gtts, pass_args=True, run_async=True))
dispatcher.add_handler(
    DisableAbleCommandHandler("spell", spellcheck, run_async=True))
Beispiel #6
0
__help__ = """

Blacklists are used to stop certain triggers from being said in a group. Any time the trigger is mentioned, the message will immediately be deleted. A good combo is sometimes to pair this up with warn filters!

*NOTE*: Blacklists do not affect group admins.

 × /blacklist: View the current blacklisted words.

Admin only:
 × /addblacklist <triggers>: Add a trigger to the blacklist. Each line is considered one trigger, so using different lines will allow you to add multiple triggers.
 × /unblacklist <triggers>: Remove triggers from the blacklist. Same newline logic applies here, so you can remove multiple triggers at once.
 × /rmblacklist <triggers>: Same as above.
 × /blacklistmode <off/del/warn/ban/kick/mute/tban/tmute>: Action to perform when someone sends blacklisted words.
"""
BLACKLIST_HANDLER = DisableAbleCommandHandler(
    "blacklist", blacklist, pass_args=True, admin_ok=True, run_async=True
)
ADD_BLACKLIST_HANDLER = CommandHandler(
    "addblacklist", add_blacklist, run_async=True
)
UNBLACKLIST_HANDLER = CommandHandler(
    ["unblacklist", "rmblacklist"], unblacklist, run_async=True
)
BLACKLISTMODE_HANDLER = CommandHandler(
    "blacklistmode", blacklist_mode, pass_args=True, run_async=True
)
BLACKLIST_DEL_HANDLER = MessageHandler(
    (Filters.text | Filters.command | Filters.sticker | Filters.photo)
    & Filters.chat_type.groups,
    del_blacklist,
    run_async=True,
Beispiel #7
0
Locks can be used to restrict a group's users.
eg:
Locking urls will auto-delete all messages with urls, locking stickers will restrict all \
non-admin users from sending stickers, etc.
Locking bots will stop non-admins from adding bots to the chat.

Note:
 • Unlocking permission *info* will allow members (non-admins) to change the group information, such as the description or the group name
 • Unlocking permission *pin* will allow members (non-admins) to pinned a message in a group
"""

__mod_name__ = "Locks"

LOCKTYPES_HANDLER = DisableAbleCommandHandler("locktypes",
                                              locktypes,
                                              run_async=True)
# , filters=Filters.chat_type.groups)
LOCK_HANDLER = CommandHandler("lock", lock, pass_args=True, run_async=True)
UNLOCK_HANDLER = CommandHandler(
    "unlock", unlock, pass_args=True,
    run_async=True)  # , filters=Filters.chat_type.groups)
# , filters=Filters.chat_type.groups)
LOCKED_HANDLER = CommandHandler("locks", list_locks, run_async=True)

dispatcher.add_handler(LOCK_HANDLER)
dispatcher.add_handler(UNLOCK_HANDLER)
dispatcher.add_handler(LOCKTYPES_HANDLER)
dispatcher.add_handler(LOCKED_HANDLER)

dispatcher.add_handler(
Beispiel #8
0
def scam(imgspage, lim):
    """Parse/Scrape the HTML code for the info we want."""

    single = opener.open(imgspage).read()
    decoded = single.decode("utf-8")
    if int(lim) > 10:
        lim = 10

    imglinks = []
    counter = 0

    pattern = r"^,\[\"(.*[.png|.jpg|.jpeg])\",[0-9]+,[0-9]+\]$"
    oboi = re.findall(pattern, decoded, re.I | re.M)

    for imglink in oboi:
        counter += 1
        imglinks.append(imglink)
        if counter >= int(lim):
            break

    return imglinks


REVERSE_HANDLER = DisableAbleCommandHandler("reverse",
                                            reverse,
                                            pass_args=True,
                                            admin_ok=True,
                                            run_async=True)

dispatcher.add_handler(REVERSE_HANDLER)
Beispiel #9
0
*Regex based memes:*

`/decide` can be also used with regex like: `ubotindo What? <question>: randomly answer "Yes, No" etc.`

Some other regex filters are:
`me too` | `good morning` | `good night`.

Userbotindobot will reply random strings accordingly when these words are used!
All regex filters can be disabled incase u don't want... like: `/disable metoo`.

"""

__mod_name__ = "Memes"

SHRUG_HANDLER = DisableAbleCommandHandler("shrug", shrug, run_async=True)
DECIDE_HANDLER = DisableAbleMessageHandler(Filters.regex(r"(?i)(ubotindo)"),
                                           decide,
                                           friendly="decide",
                                           run_async=True)
SNIPE_HANDLER = CommandHandler(
    "snipe",
    snipe,
    pass_args=True,
    filters=CustomFilters.sudo_filter,
    run_async=True,
)
ABUSE_HANDLER = DisableAbleCommandHandler("abuse", abuse, run_async=True)
POLICE_HANDLER = DisableAbleCommandHandler("police", police, run_async=True)
RUNS_HANDLER = DisableAbleCommandHandler("runs", runs, run_async=True)
SLAP_HANDLER = DisableAbleCommandHandler("slap",
Beispiel #10
0

__help__ = """
Get Latest magisk relese, Twrp for your device or info about some device using its codename, Directly from Bot!

*Android related commands:*

 × /magisk - Gets the latest magisk release for Stable/Beta/Canary.
 × /device <codename> - Gets android device basic info from its codename.
 × /twrp <codename> -  Gets latest twrp for the android device using the codename.
 × /los <codename> - Gets Latest los build.
"""

__mod_name__ = "Android"

MAGISK_HANDLER = DisableAbleCommandHandler("magisk", magisk, run_async=True)
DEVICE_HANDLER = DisableAbleCommandHandler("device",
                                           device,
                                           pass_args=True,
                                           run_async=True)
TWRP_HANDLER = DisableAbleCommandHandler("twrp",
                                         twrp,
                                         pass_args=True,
                                         run_async=True)
LOS_HANDLER = DisableAbleCommandHandler("los",
                                        los,
                                        pass_args=True,
                                        run_async=True)
BOOTLEG_HANDLER = DisableAbleCommandHandler("bootleg",
                                            bootleg,
                                            pass_args=True,
Beispiel #11
0
    else:
        update.effective_message.reply_text("Whadya want to delete?")

    return ""


__help__ = """
Deleting messages made easy with this command. Bot purges \
messages all together or individually.

*Admin only:*
 × /del: Deletes the message you replied to
 × /purge: Deletes all messages between this and the replied to message.
 × /purge <integer X>: Deletes the replied message, and X messages following it.
"""

__mod_name__ = "Purges"

DELETE_HANDLER = DisableAbleCommandHandler("del",
                                           del_message,
                                           filters=Filters.chat_type.groups,
                                           run_async=True)
PURGE_HANDLER = DisableAbleCommandHandler("purge",
                                          purge,
                                          filters=Filters.chat_type.groups,
                                          pass_args=True,
                                          run_async=True)

dispatcher.add_handler(DELETE_HANDLER)
dispatcher.add_handler(PURGE_HANDLER)
Beispiel #12
0
 × /rmallfilter: Stop all chat filters at once.

*Note*: Filters also support markdown formatters like: {first}, {last} etc.. and buttons.
Check `/markdownhelp` to know more!

"""

__mod_name__ = "Filters"

FILTER_HANDLER = CommandHandler("filter", filters)
STOP_HANDLER = CommandHandler("stop", stop_filter)  # Don't Use async for this
RMALLFILTER_HANDLER = CommandHandler("rmallfilter",
                                     rmall_filters,
                                     filters=Filters.chat_type.groups,
                                     run_async=True)
LIST_HANDLER = DisableAbleCommandHandler("filters",
                                         list_handlers,
                                         admin_ok=True,
                                         run_async=True)
CUST_FILTER_HANDLER = MessageHandler(
    CustomFilters.has_text & ~Filters.update.edited_message,
    reply_filter,
    run_async=True,
)

dispatcher.add_handler(FILTER_HANDLER)
dispatcher.add_handler(STOP_HANDLER)
dispatcher.add_handler(LIST_HANDLER)
dispatcher.add_handler(CUST_FILTER_HANDLER, HANDLER_GROUP)
dispatcher.add_handler(RMALLFILTER_HANDLER)
Beispiel #13
0
"""

__mod_name__ = "Notes"

GET_HANDLER = CommandHandler("get", cmd_get, pass_args=True, run_async=True)
HASH_GET_HANDLER = MessageHandler(
    Filters.regex(r"^#[^\s]+") & ~Filters.chat_type.channel,
    hash_get,
    run_async=True,
)

SAVE_HANDLER = CommandHandler("save", save, run_async=True)
DELETE_HANDLER = CommandHandler("clear", clear, pass_args=True, run_async=True)

LIST_HANDLER = DisableAbleCommandHandler(["notes", "saved"],
                                         list_notes,
                                         admin_ok=True,
                                         run_async=True)
CLEARALLNOTES_HANDLER = CommandHandler("rmallnotes",
                                       clear_notes,
                                       filters=Filters.chat_type.groups,
                                       run_async=True)

RMBTN_HANDLER = CallbackQueryHandler(rmbutton,
                                     pattern=r"rmnotes_",
                                     run_async=True)

dispatcher.add_handler(GET_HANDLER)
dispatcher.add_handler(SAVE_HANDLER)
dispatcher.add_handler(LIST_HANDLER)
dispatcher.add_handler(DELETE_HANDLER)
dispatcher.add_handler(HASH_GET_HANDLER)
Beispiel #14
0
 × /reverse : Reverse searches image or stickers on google.
 × /covid <country name>: Give stats about COVID-19.
 × /paste : Paste any text file to Nekobin.
 × /gdpr: Deletes your information from the bot's database. Private chats only.
 × /markdownhelp: Quick summary of how markdown works in telegram - can only be called in private chats.

Last.FM
 × /setuser <username>: sets your last.fm username.
 × /clearuser: removes your last.fm username from the bot's database.
 × /lastfm: returns what you're scrobbling on last.fm.
"""

__mod_name__ = "Miscs"

ID_HANDLER = DisableAbleCommandHandler("id",
                                       get_id,
                                       pass_args=True,
                                       run_async=True)
INFO_HANDLER = DisableAbleCommandHandler("info",
                                         info,
                                         pass_args=True,
                                         run_async=True)
ECHO_HANDLER = CommandHandler("echo",
                              echo,
                              filters=CustomFilters.sudo_filter,
                              run_async=True)
MD_HELP_HANDLER = CommandHandler("markdownhelp",
                                 markdown_help,
                                 filters=Filters.private,
                                 run_async=True)
STATS_HANDLER = CommandHandler("stats",
                               stats,
Beispiel #15
0
SETSTICKET_HANDLER = CommandHandler(
    "setsticker", set_sticker, filters=Filters.chat_type.groups, run_async=True
)
SETDESC_HANDLER = CommandHandler(
    "setdescription", set_desc, filters=Filters.chat_type.groups, run_async=True
)

PROMOTE_HANDLER = CommandHandler(
    "promote", promote, pass_args=True, filters=Filters.chat_type.groups, run_async=True
)
DEMOTE_HANDLER = CommandHandler(
    "demote", demote, pass_args=True, filters=Filters.chat_type.groups, run_async=True
)

SET_TITLE_HANDLER = DisableAbleCommandHandler(
    "settitle", set_title, pass_args=True, run_async=True
)
ADMINLIST_HANDLER = DisableAbleCommandHandler(
    "adminlist", adminlist, filters=Filters.chat_type.groups, run_async=True
)
ADMIN_REFRESH_HANDLER = CommandHandler(
    "admincache", refresh_admin, run_async=True
)


dispatcher.add_handler(PIN_HANDLER)
dispatcher.add_handler(UNPIN_HANDLER)
dispatcher.add_handler(INVITE_HANDLER)
dispatcher.add_handler(PROMOTE_HANDLER)
dispatcher.add_handler(DEMOTE_HANDLER)
dispatcher.add_handler(ADMINLIST_HANDLER)
Beispiel #16
0
            f"{mention_html(msg.from_user.id, msg.from_user.first_name)}" +
            ", Please reply to sticker message to get id sticker",
            parse_mode=ParseMode.HTML,
        )


__help__ = """
Kanging Stickers made easy with stickers module!

× /stickerid: Reply to a sticker to me to tell you its file ID.
× /getsticker: Reply to a sticker to me to upload its raw PNG file.
× /kang: Reply to a sticker to add it to your pack.
"""

__mod_name__ = "Stickers"
KANG_HANDLER = DisableAbleCommandHandler("kang",
                                         kang,
                                         pass_args=True,
                                         admin_ok=True,
                                         run_async=True)
STICKERID_HANDLER = DisableAbleCommandHandler("stickerid",
                                              stickerid,
                                              run_async=True)
GETSTICKER_HANDLER = DisableAbleCommandHandler("getsticker",
                                               getsticker,
                                               run_async=True)

dispatcher.add_handler(KANG_HANDLER)
dispatcher.add_handler(STICKERID_HANDLER)
dispatcher.add_handler(GETSTICKER_HANDLER)
Beispiel #17
0
    temp_ban,
    pass_args=True,
    filters=Filters.chat_type.groups,
    run_async=True,
)
KICK_HANDLER = CommandHandler("kick",
                              kick,
                              pass_args=True,
                              filters=Filters.chat_type.groups,
                              run_async=True)
UNBAN_HANDLER = CommandHandler("unban",
                               unban,
                               pass_args=True,
                               filters=Filters.chat_type.groups,
                               run_async=True)
KICKME_HANDLER = DisableAbleCommandHandler("kickme",
                                           kickme,
                                           filters=Filters.chat_type.groups,
                                           run_async=True)
BANME_HANDLER = DisableAbleCommandHandler("banme",
                                          banme,
                                          filters=Filters.chat_type.groups,
                                          run_async=True)

dispatcher.add_handler(BAN_HANDLER)
dispatcher.add_handler(TEMPBAN_HANDLER)
dispatcher.add_handler(KICK_HANDLER)
dispatcher.add_handler(UNBAN_HANDLER)
dispatcher.add_handler(KICKME_HANDLER)
dispatcher.add_handler(BANME_HANDLER)
Beispiel #18
0
        last_user = (requests.get(
            f"{base_url}?method=user.getinfo&user={username}&api_key={LASTFM_API_KEY}&format=json"
        ).json().get("user"))
        scrobbles = last_user.get("playcount")
        rep += f"\n(<code>{scrobbles}</code> scrobbles so far)"

    send = msg.reply_text(rep, parse_mode=ParseMode.HTML)
    time.sleep(60)
    try:
        send.delete()
        msg.delete()
    except error.BadRequest:
        return


def __stats__():
    return "× {} saved Last.FM username.".format(
        LASTFM_USER.count_documents({}))


SET_USER_HANDLER = CommandHandler("setuser",
                                  set_user,
                                  pass_args=True,
                                  run_async=True)
CLEAR_USER_HANDLER = CommandHandler("clearuser", clear_user, run_async=True)
LASTFM_HANDLER = DisableAbleCommandHandler("lastfm", last_fm, run_async=True)

dispatcher.add_handler(SET_USER_HANDLER)
dispatcher.add_handler(CLEAR_USER_HANDLER)
dispatcher.add_handler(LASTFM_HANDLER)