I am gonna merge staging into Geez-UserBot"
17 | cd
18 | git clone https://github.com/sahyam2019/oub-remix.git
19 | cd oub-remix
20 | git remote set-url origin https://${GH_USERNAME}:${GH_PERSONAL_TOKEN}@github.com/sahyam2019/oub-remix.git
21 | git fetch
22 | git checkout staging
23 | git pull origin staging
24 | git push --force origin staging:sql-extended
25 | tg_sendinfo "I have merged all commits from staging into Geez-UserBot"
26 |
--------------------------------------------------------------------------------
/init/CI_Test_Script.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Copyright (C) 2020 The Raphielscape Company LLC.
3 | #
4 | # Licensed under the Raphielscape Public License, Version 1.d (the "License");
5 | # you may not use this file except in compliance with the License.
6 | #
7 | # CI Runner Script for Paperplane CI
8 |
9 | # We need this directive
10 | # shellcheck disable=1090
11 |
12 | export SEMAPHORE_PROJECT_DIR=$(pwd)
13 | . "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/telegram
14 | TELEGRAM_TOKEN=${BOT_API_KEY}
15 | export BOT_API_KEY TELEGRAM_TOKEN
16 | tg_sendinfo "I am gonna merge staging into Geez-UserBot"
17 | cd
18 | git clone https://github.com/mkaraniya/OpenUserBot.git
19 | cd OpenUserBot
20 | git remote set-url origin https://${GH_USERNAME}:${GH_PERSONAL_TOKEN}@github.com/mkaraniya/OpenUserBot.git
21 | git fetch
22 | git checkout staging
23 | git pull origin staging
24 | git push --force origin staging: Geez-UserBot
25 | tg_sendinfo "I have merged all commits from staging into Geez-UserBot"
26 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/userbot/modules/allunban.py:
--------------------------------------------------------------------------------
1 | # Port By @VckyouuBitch From GeezProjects
2 | # Copyright © 2021 Geez-Projects
3 | from telethon.tl.types import (
4 | ChannelParticipantsKicked,
5 | )
6 |
7 | from userbot.utils import Xa_cmd
8 | from userbot import CMD_HELP, CMD_HANDLER as cmd
9 |
10 |
11 | @Xa_cmd(pattern="allunban(?: |$)(.*)")
12 | async def _(event):
13 | await event.edit("`Sedang Mencari List Banning.`")
14 | p = 0
15 | (await event.get_chat()).title
16 | async for i in event.client.iter_participants(
17 | event.chat_id,
18 | filter=ChannelParticipantsKicked,
19 | aggressive=True,
20 | ):
21 | try:
22 | await event.client.edit_permissions(event.chat_id, i, view_messages=True)
23 | p += 1
24 | except BaseException:
25 | pass
26 | await event.edit("`Sukses Menghapus List Banning`")
27 |
28 |
29 | CMD_HELP.update(
30 | {
31 | "allunban": f"𝘾𝙤𝙢𝙢𝙖𝙣𝙙: `{cmd}allunban`\
32 | \n↳ : Membatalkan semua Ban Di Anggota Grup."
33 | }
34 | )
35 |
--------------------------------------------------------------------------------
/.github/workflows/python-app.yml:
--------------------------------------------------------------------------------
1 | #repoUserbot
2 | name: FailCheck
3 |
4 | on: [push, pull_request]
5 |
6 | jobs:
7 | build:
8 |
9 | runs-on: ubuntu-latest
10 | strategy:
11 | max-parallel: 5
12 | matrix:
13 | python-version: [3.9]
14 |
15 | steps:
16 | - uses: actions/checkout@v1
17 | - name: Set up Python ${{ matrix.python-version }}
18 | uses: actions/setup-python@v1
19 | with:
20 | python-version: ${{ matrix.python-version }}
21 | - name: Install dependencies
22 | run: |
23 | sudo apt-get install libpq-dev
24 | python -m pip install --upgrade pip
25 | pip install -r requirements.txt
26 | pip install flake8 flake8-print flake8-quotes
27 | - name: Check for showstoppers
28 | run: |
29 | flake8 . --count --select=E999 --show-source --statistics
30 | shellcheck:
31 |
32 | runs-on: ubuntu-latest
33 |
34 | steps:
35 | - uses: actions/checkout@v1
36 | - name: Check for install script errors
37 | uses: ludeeus/action-shellcheck@0.1.0
38 |
--------------------------------------------------------------------------------
/userbot/modules/sql_helper/mute_sql.py:
--------------------------------------------------------------------------------
1 | try:
2 | from userbot.modules.sql_helper import SESSION, BASE
3 | except ImportError:
4 | raise Exception("Hello!")
5 |
6 | from sqlalchemy import Column, String
7 |
8 |
9 | class Mute(BASE):
10 | __tablename__ = "mute"
11 | sender = Column(String(14), primary_key=True)
12 | chat_id = Column(String(14), primary_key=True)
13 |
14 | def __init__(self, sender, chat_id):
15 | self.sender = str(sender)
16 | self.chat_id = str(chat_id)
17 |
18 |
19 | Mute.__table__.create(checkfirst=True)
20 |
21 |
22 | def is_muted(sender, chat_id):
23 | user = SESSION.query(Mute).get((str(sender), str(chat_id)))
24 | if user:
25 | return True
26 | else:
27 | return False
28 |
29 |
30 | def mute(sender, chat_id):
31 | adder = Mute(str(sender), str(chat_id))
32 | SESSION.add(adder)
33 | SESSION.commit()
34 |
35 |
36 | def unmute(sender, chat_id):
37 | rem = SESSION.query(Mute).get((str(sender), str(chat_id)))
38 | if rem:
39 | SESSION.delete(rem)
40 | SESSION.commit()
41 |
--------------------------------------------------------------------------------
/userbot/modules/surat.py:
--------------------------------------------------------------------------------
1 | from time import sleep
2 |
3 | from userbot import CMD_HELP, CMD_HANDLER as cmd
4 | from userbot.utils import Xa_cmd
5 |
6 |
7 | @Xa_cmd(pattern='alfatihah(?: |$)(.*)')
8 | async def typewriter(typew):
9 | typew.pattern_match.group(1)
10 | sleep(1)
11 | await typew.edit("**SURAT ALFATIHAH**")
12 | sleep(1)
13 | await typew.edit("**bismillāhir-raḥmānir-raḥīm**")
14 | sleep(1)
15 | await typew.edit("**al-ḥamdu lillāhi rabbil-'ālamīn**")
16 | sleep(1)
17 | await typew.edit("**ar-raḥmānir-raḥīm**")
18 | sleep(1)
19 | await typew.edit("**māliki yaumid-dīn**")
20 | sleep(1)
21 | await typew.edit("**iyyāka na'budu wa iyyāka nasta'īn**")
22 | sleep(1)
23 | await typew.edit("**ihdinaṣ-ṣirāṭal-mustaqīm**")
24 | sleep(1)
25 | await typew.edit("**ṣirāṭallażīna an'amta 'alaihim gairil-magḍụbi 'alaihim wa laḍ-ḍāllīn**")
26 | sleep(1)
27 | await typew.edit("**Amin..**")
28 | # Create by myself @localheart
29 |
30 | CMD_HELP.update({
31 | "surat":
32 | f"𝘾𝙤𝙢𝙢𝙖𝙣𝙙: `{cmd}alfatihah`\
33 | \n↳ : Surat Alfatihah."
34 | })
35 |
--------------------------------------------------------------------------------
/userbot/modules/sql_helper/fban_sql.py:
--------------------------------------------------------------------------------
1 | try:
2 | from userbot.modules.sql_helper import SESSION, BASE
3 | except ImportError:
4 | raise AttributeError
5 |
6 | from sqlalchemy import Column, String, UnicodeText
7 |
8 |
9 | class Fban(BASE):
10 | __tablename__ = "fban"
11 | chat_id = Column(String(14), primary_key=True)
12 | fed_name = Column(UnicodeText)
13 |
14 | def __init__(self, chat_id, fed_name):
15 | self.chat_id = str(chat_id)
16 | self.fed_name = fed_name
17 |
18 |
19 | Fban.__table__.create(checkfirst=True)
20 |
21 |
22 | def get_flist():
23 | try:
24 | return SESSION.query(Fban).all()
25 | finally:
26 | SESSION.close()
27 |
28 |
29 | def add_flist(chat_id, fed_name):
30 | adder = Fban(str(chat_id), fed_name)
31 | SESSION.add(adder)
32 | SESSION.commit()
33 |
34 |
35 | def del_flist(chat_id):
36 | rem = SESSION.query(Fban).get(str(chat_id))
37 | if rem:
38 | SESSION.delete(rem)
39 | SESSION.commit()
40 |
41 |
42 | def del_flist_all():
43 | SESSION.execute("""TRUNCATE TABLE fban""")
44 | SESSION.commit()
45 |
--------------------------------------------------------------------------------
/userbot/modules/sql_helper/spam_mute_sql.py:
--------------------------------------------------------------------------------
1 | try:
2 | from userbot.modules.sql_helper import SESSION, BASE
3 | except ImportError:
4 | raise AttributeError
5 |
6 | from sqlalchemy import Column, String
7 |
8 |
9 | class Mute(BASE):
10 | __tablename__ = "muted"
11 | chat_id = Column(String(14), primary_key=True)
12 | sender = Column(String(14), primary_key=True)
13 |
14 | def __init__(self, chat_id, sender):
15 | self.chat_id = str(chat_id) # ensure string
16 | self.sender = str(sender)
17 |
18 |
19 | Mute.__table__.create(checkfirst=True)
20 |
21 |
22 | def is_muted(chat_id):
23 | try:
24 | return SESSION.query(Mute).filter(Mute.chat_id == str(chat_id)).all()
25 | except BaseException:
26 | return None
27 | finally:
28 | SESSION.close()
29 |
30 |
31 | def mute(chat_id, sender):
32 | adder = Mute(str(chat_id), str(sender))
33 | SESSION.add(adder)
34 | SESSION.commit()
35 |
36 |
37 | def unmute(chat_id, sender):
38 | rem = SESSION.query(Mute).get(((str(chat_id)), (str(sender))))
39 | if rem:
40 | SESSION.delete(rem)
41 | SESSION.commit()
42 |
--------------------------------------------------------------------------------
/userbot/modules/xahelper.py:
--------------------------------------------------------------------------------
1 | """ Userbot module for other small commands. """
2 | from userbot import CMD_HELP, ALIVE_NAME
3 | from userbot.events import register
4 |
5 |
6 | # ================= CONSTANT =================
7 | DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else uname().node
8 | # ============================================
9 |
10 |
11 | @register(outgoing=True, pattern="^.lhelp$")
12 | async def usit(e):
13 | await e.edit(
14 | f"**Halo {DEFAULTUSER} Jika Anda Tidak Tau Perintah Untuk Memerintah Ku Ketik** `.help` Atau Bisa Minta Bantuan Ke:\n"
15 | "\n[Telegram](t.me/JustRex)"
16 | "\n[Repo](https://github.com/S/Xa-Userbot)"
17 | "\n[Instagram](instagram.com/syhndr_)")
18 |
19 |
20 | @register(outgoing=True, pattern="^.vars$")
21 | async def var(m):
22 | await m.edit(
23 | f"**Disini Daftar Vars Dari {DEFAULTUSER}:**\n"
24 | "\n[DAFTAR VARS](https://raw.githubusercontent.com/Rexashh/Xa-Userbot/Xa-Userbot/varshelper.txt)")
25 |
26 |
27 | CMD_HELP.update({
28 | "helper":
29 | "`.lhelp`\
30 | \nUsage: Bantuan Untuk Xa-Userbot.\
31 | \n`.vars`\
32 | \nUsage: Melihat Daftar Vars."
33 | })
34 |
--------------------------------------------------------------------------------
/userbot/modules/sql_helper/pm_permit_sql.py:
--------------------------------------------------------------------------------
1 | try:
2 | from userbot.modules.sql_helper import SESSION, BASE
3 | except ImportError:
4 | raise AttributeError
5 | from sqlalchemy import Column, String
6 |
7 |
8 | class PMPermit(BASE):
9 | __tablename__ = "pmpermit"
10 | chat_id = Column(String(14), primary_key=True)
11 |
12 | def __init__(self, chat_id):
13 | self.chat_id = str(chat_id) # ensure string
14 |
15 |
16 | PMPermit.__table__.create(checkfirst=True)
17 |
18 |
19 | def is_approved(chat_id):
20 | try:
21 | return SESSION.query(PMPermit).filter(
22 | PMPermit.chat_id == str(chat_id)).one()
23 | except BaseException:
24 | return None
25 | finally:
26 | SESSION.close()
27 |
28 |
29 | def approve(chat_id):
30 | adder = PMPermit(str(chat_id))
31 | SESSION.add(adder)
32 | SESSION.commit()
33 |
34 |
35 | def dissprove(chat_id):
36 | rem = SESSION.query(PMPermit).get(str(chat_id))
37 | if rem:
38 | SESSION.delete(rem)
39 | SESSION.commit()
40 |
41 |
42 | def get_all_approved():
43 | rem = SESSION.query(PMPermit).all()
44 | SESSION.close()
45 | return rem
46 |
--------------------------------------------------------------------------------
/.github/workflows/pylint.yml:
--------------------------------------------------------------------------------
1 | name: PyLint
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | PEP8:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/checkout@v2
10 |
11 | - name: Setup Python
12 | uses: actions/setup-python@v1
13 | with:
14 | python-version: 3.9
15 |
16 | - name: Install Python lint libraries
17 | run: |
18 | pip install autopep8 autoflake
19 | - name: Check for showstoppers
20 | run: |
21 | autopep8 --verbose --in-place --recursive --aggressive --aggressive . *.py
22 | - name: Remove unused imports and variables
23 | run: |
24 | autoflake --in-place --recursive --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports .
25 |
26 | # commit changes
27 | - uses: stefanzweifel/git-auto-commit-action@v4
28 | with:
29 | commit_message: 'pylint: auto fixes'
30 | commit_options: '--no-verify --signoff'
31 | repository: .
32 | commit_user_name: Rexashh
33 | commit_user_email: tirexijo@gmail.com
34 | commit_author: Rexashh STRING_SESSION: {}
24 | ⚠️ Please be careful before passing this value to third parties""".format(session_string)
25 | client.send_message("me", saved_messages_template, parse_mode="html")
26 |
--------------------------------------------------------------------------------
/init/telegram:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env dash
2 | # shellcheck source=/dev/null
3 | #
4 | # Copyright (C) 2020 Raphielscape LLC.
5 | #
6 | # Licensed under the Raphielscape Public License, Version 1.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | #
9 | # Telegram command container
10 |
11 | TELEGRAM=$SEMAPHORE_PROJECT_DIR/init/telegramapi
12 | export TELEGRAM
13 | # Caster configurations
14 | MAINGROUP_ID="-1001180648994"
15 |
16 | # sendcast to group
17 | tg_sendinfo() {
18 | "${TELEGRAM}" -c ${MAINGROUP_ID} -H \
19 | "$(
20 | for POST in "${@}"; do
21 | echo "${POST}"
22 | done
23 | )" \
24 | -t $BOT_API_KEY
25 | }
26 |
27 | kickstart_pub() {
28 | if [ ! -z "$PULL_REQUEST_NUMBER" ]; then
29 | tg_sendinfo "I am starting build" \
30 | "PR: ${PULL_REQUEST_NUMBER}" \
31 | "Commit Point ${COMMIT_POINT}" \
32 | " " \
33 | "Github Link: https://github.com/muhammadrizky16/Kyy-Userbot/${COMMIT_HASH}"
34 | else
35 | tg_sendinfo "I am starting build" \
36 | "Branch ${PARSE_BRANCH}" \
37 | "Commit Point ${COMMIT_POINT}" \
38 | " " \
39 | "Github Link: https://github.com/muhammadrizky16/Kyy-Userbot/commit/${COMMIT_HASH}"
40 | fi
41 | }
42 |
--------------------------------------------------------------------------------
/userbot/modules/sql_helper/gban_sql.py:
--------------------------------------------------------------------------------
1 | from sqlalchemy import Column, String
2 |
3 | from userbot.modules.sql_helper import BASE, SESSION
4 |
5 |
6 | class GBan(BASE):
7 | __tablename__ = "gban"
8 | chat_id = Column(String(14), primary_key=True)
9 | reason = Column(String(127))
10 |
11 | def __init__(self, chat_id, reason=""):
12 | self.chat_id = chat_id
13 | self.reason = reason
14 |
15 |
16 | GBan.__table__.create(checkfirst=True)
17 |
18 |
19 | def is_gbanned(chat_id):
20 | try:
21 | return SESSION.query(GBan).filter(
22 | GBan.chat_id == str(chat_id)).one()
23 | except BaseException:
24 | return None
25 | finally:
26 | SESSION.close()
27 |
28 |
29 | def get_gbanuser(chat_id):
30 | try:
31 | return SESSION.query(GBan).get(str(chat_id))
32 | finally:
33 | SESSION.close()
34 |
35 |
36 | def freakgban(chat_id):
37 | adder = GBan(str(chat_id))
38 | SESSION.add(adder)
39 | SESSION.commit()
40 |
41 |
42 | def freakungban(chat_id):
43 | rem = SESSION.query(GBan).get(str(chat_id))
44 | if rem:
45 | SESSION.delete(rem)
46 | SESSION.commit()
47 |
48 |
49 | def get_all_gbanned():
50 | rem = SESSION.query(GBan).all()
51 | SESSION.close()
52 | return rem
53 |
--------------------------------------------------------------------------------
/userbot/modules/dbs.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2019 The Raphielscape Company LLC.
2 | #
3 | # Licensed under the Raphielscape Public License, Version 1.d (the "License");
4 | # you may not use this file except in compliance with the License.
5 | #
6 | """ Userbot module for getting information about the server. """
7 |
8 | from platform import uname
9 |
10 |
11 | from userbot import ALIVE_NAME, BOT_VER, is_mongo_alive, is_redis_alive
12 | from userbot.events import register
13 |
14 | # ================= CONSTANT =================
15 | DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else uname().node
16 | # ============================================
17 |
18 |
19 | @register(outgoing=True, pattern="^.db$")
20 | async def amireallydbs(dbs):
21 | if not is_mongo_alive() and not is_redis_alive():
22 | db = "Both Mongo and Redis Database seems to be failing!"
23 | elif not is_mongo_alive():
24 | db = "Mongo DB seems to be failing!"
25 | elif not is_redis_alive():
26 | db = "Redis Cache seems to be failing!"
27 | else:
28 | db = "Databases functioning normally!"
29 | await dbs.edit(""
30 | f"**User :** `{DEFAULTUSER}` \n"
31 | f"**Status Database:** `{db}`\n"
32 | f"**Kyy-Userbot :** `{BOT_VER}`"
33 | "")
34 |
--------------------------------------------------------------------------------
/userbot/modules/resi.py:
--------------------------------------------------------------------------------
1 |
2 | from telethon import events
3 | from telethon.errors.rpcerrorlist import YouBlockedUserError
4 | from userbot import bot, CMD_HELP
5 | from userbot.events import register
6 |
7 |
8 | @register(outgoing=True, pattern=r"^\.resi(?: |$)(.*)")
9 | async def _(event):
10 | if event.fwd_from:
11 | return
12 | event.pattern_match.group(1)
13 | chat = "@GeDebugBetaBot" # pylint:disable=E0602
14 | resi = f"resi" # pylint:disable=E0602
15 | await event.edit("Processing....")
16 | async with bot.conversation("@GeDebugBetaBot") as conv:
17 | try:
18 | response = conv.wait_event(
19 | events.NewMessage(
20 | incoming=True,
21 | from_users=443213072))
22 | await conv.send_message(f'{kurir} {resi}')
23 | response = await response
24 | except YouBlockedUserError:
25 | await event.reply("Unblock @ GeDebugBetaBot dulu Goblok!!")
26 | return
27 | else:
28 | await event.edit(f"{response.message.message}")
29 | await event.client.delete_messages(response.message.message)
30 |
31 |
32 | CMD_HELP.update({
33 | "resi":
34 | "`.resi`\
35 | \nUsage: Cek resi \
36 | \n\n`.lacak`\
37 | \nUsage:lacak paket"
38 | })
39 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions
2 |
3 | name: CI
4 |
5 | # Controls when the action will run.
6 | on:
7 | # Triggers the workflow on push or pull request events but only for the Kyy-Userbot branch
8 | push:
9 | branches: [ Xa-Userbot ]
10 | pull_request:
11 | branches: [ Xa-Userbot ]
12 |
13 | # Allows you to run this workflow manually from the Actions tab
14 | workflow_dispatch:
15 |
16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel
17 | jobs:
18 | # This workflow contains a single job called "build"
19 | build:
20 | # The type of runner that the job will run on
21 | runs-on: ubuntu-latest
22 |
23 | # Steps represent a sequence of tasks that will be executed as part of the job
24 | steps:
25 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26 | - uses: actions/checkout@v2
27 |
28 | # Runs a single command using the runners shell
29 | - name: Run a one-line script
30 | run: echo Hello, world!
31 |
32 | # Runs a set of commands using the runners shell
33 | - name: Run a multi-line script
34 | run: |
35 | echo Add other actions to build,
36 | echo test, and deploy your project.
37 |
--------------------------------------------------------------------------------
/userbot/modules/hentai.py:
--------------------------------------------------------------------------------
1 | from telethon import events
2 | from telethon.errors.rpcerrorlist import YouBlockedUserError
3 | from userbot import bot, CMD_HELP
4 | from userbot.events import register
5 |
6 |
7 | @register(outgoing=True, pattern=r"^\.hentai(?: |$)(.*)")
8 | async def _(event):
9 | if event.fwd_from:
10 | return
11 | link = event.pattern_match.group(1)
12 | chat = "@nHentaiBot"
13 | await event.edit("```Processing```")
14 | async with bot.conversation(chat) as conv:
15 | try:
16 | response = conv.wait_event(
17 | events.NewMessage(
18 | incoming=True,
19 | from_users=424466890))
20 | await bot.send_message(chat, link)
21 | response = await response
22 | except YouBlockedUserError:
23 | await event.reply("```Please unblock @nHentaiBot and try again```")
24 | return
25 | if response.text.startswith("**Sorry I couldn't get manga from**"):
26 | await event.edit("```I think this is not the right link```")
27 | else:
28 | await event.delete()
29 | await bot.send_message(event.chat_id, response.message)
30 |
31 | CMD_HELP.update({
32 | "hentai":
33 | "`.hentai` \
34 | \nUsage: view nhentai in telegra.ph XD\n"})
35 |
--------------------------------------------------------------------------------
/userbot/modules/salam.py:
--------------------------------------------------------------------------------
1 | from platform import uname
2 | from userbot import ALIVE_NAME, CMD_HELP, CMD_HANDLER as cmd
3 | from userbot.utils import Xa_cmd
4 |
5 | # ================= CONSTANT =================
6 | DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else uname().node
7 | # ============================================
8 |
9 |
10 | @Xa_cmd(pattern='^P(?: |$)(.*)')
11 | async def typewriter(typew):
12 | typew.pattern_match.group(1)
13 | await typew.edit("Assalamualaikum, yang ga jawab KAFIR!")
14 |
15 |
16 | @Xa_cmd(pattern='atg(?: |$)(.*)')
17 | async def typewriter(typew):
18 | typew.pattern_match.group(1)
19 | await typew.edit("𝐀𝐒𝐓𝐀𝐆𝐇𝐅𝐈𝐑𝐔𝐋𝐋𝐀𝐇....SAYANG!!!!")
20 |
21 |
22 | @Xa_cmd(pattern='^L(?: |$)(.*)')
23 | async def typewriter(typew):
24 | typew.pattern_match.group(1)
25 | await typew.edit("Wallaikumsalam")
26 |
27 |
28 | @Xa_cmd(pattern='ast(?: |$)(.*)')
29 | async def typewriter(typew):
30 | typew.pattern_match.group(1)
31 | await typew.edit("𝐀𝐒𝐓𝐀𝐆𝐇𝐅𝐈𝐑𝐔𝐋𝐋𝐀𝐇......")
32 |
33 |
34 | CMD_HELP.update({
35 | "salam":
36 | "P\
37 | \nUsage: Untuk Memberi salam.\
38 | \n\nL\
39 | \nUsage: Untuk Menjawab Salam."
40 | })
41 |
42 |
43 | CMD_HELP.update({
44 | "salam2":
45 | f"{cmd}atg\
46 | \nUsage: Istighfar 1.\
47 | \n\n{cmd}ast\
48 | \nUsage: Istighfaf 2."
49 | })
50 |
--------------------------------------------------------------------------------
/userbot/modules/gps.py:
--------------------------------------------------------------------------------
1 | #credits: mrconfused
2 | from geopy.geocoders import Nominatim
3 | from telethon.tl import types
4 | from userbot.events import register
5 | from userbot import CMD_HELP
6 |
7 |
8 | @register(outgoing=True, pattern="^.gps(?: |$)(.*)")
9 | async def gps(event):
10 | if event.fwd_from:
11 | return
12 | reply_to_id = event.message
13 | if event.reply_to_msg_id:
14 | reply_to_id = await event.get_reply_message()
15 | input_str = event.pattern_match.group(1)
16 |
17 | if not input_str:
18 | return await event.edit("`Mohon Berikan Tempat Yang Dicari`")
19 |
20 | await event.edit("`Menemukan Lokasi Ini Di Server Map....`")
21 |
22 | geolocator = Nominatim(user_agent="Geez")
23 | geoloc = geolocator.geocode(input_str)
24 |
25 | if geoloc:
26 | lon = geoloc.longitude
27 | lat = geoloc.latitude
28 | await reply_to_id.reply(
29 | input_str,
30 | file=types.InputMediaGeoPoint(
31 | types.InputGeoPoint(
32 | lat, lon
33 | )
34 | )
35 | )
36 | await event.delete()
37 | else:
38 | await event.edit("`Saya Tidak Dapat Menemukannya`")
39 |
40 | CMD_HELP.update({
41 | "gps":
42 | ">.`gps`"
43 | "\nUsage: Untuk Mendapatkan Lokasi Map"
44 | })
45 |
--------------------------------------------------------------------------------
/userbot/modules/inlineon.py:
--------------------------------------------------------------------------------
1 | # inspiration from Man-Userbot
2 | # plugins by Fariz {geez1}\nCountry code:- {geez2}\nState name :-{geez3}\nCity name :- {geez4}\nzip :-{geez5}\nLatitude:- {geez6}\nLongitude :- {geez7}\n",
36 | parse_mode="HTML",
37 | )
38 |
39 |
40 | CMD_HELP.update(
41 | {
42 | "fakeaddress": "**IP HACK**\
43 | \n\n**Syntax : **`.ip {}"
31 | elif isinstance(e, types.MessageEntityStrike):
32 | tag = "{}"
35 | elif isinstance(e, types.MessageEntityUnderline):
36 | tag = "{}"
37 | if tag:
38 | rep = tag.format(rep)
39 | newstr = re.sub(re.escape(match.group(0)), rep, newstr)
40 | if newstr != event.text:
41 | await event.edit(newstr, parse_mode="html")
42 |
43 |
44 | CMD_HELP.update(
45 | {
46 | "mentions": "Mentions users with a custom name."
47 | "\nUsage: `Hi @ender1324[bluid boi]`"
48 | "\nResult: Hi [bluid boi](tg://resolve?domain=ender1324)"
49 | }
50 | )
51 |
--------------------------------------------------------------------------------
/userbot/modules/adzan.py:
--------------------------------------------------------------------------------
1 | import json
2 |
3 | import requests
4 |
5 | from userbot import CMD_HELP, CMD_HANDLER as cmd
6 | from userbot.utils import Xa_cmd
7 | PLACE = ""
8 |
9 |
10 | @Xa_cmd(pattern="adzan(?: |$)(.*)")
11 | async def get_adzan(adzan):
12 | if not adzan.pattern_match.group(1):
13 | LOCATION = PLACE
14 | if not LOCATION:
15 | await adzan.edit("`Harap Menentukan Kota Atau Negara.`")
16 | return
17 | else:
18 | LOCATION = adzan.pattern_match.group(1)
19 |
20 | # url = f'http://muslimsalat.com/{LOCATION}.json?key=bd099c5825cbedb9aa934e255a81a5fc'
21 | url = f"https://api.pray.zone/v2/times/today.json?city={LOCATION}"
22 | request = requests.get(url)
23 | if request.status_code == 500:
24 | return await adzan.edit(f"**Tidak Dapat Menemukan Kota** `{LOCATION}`")
25 |
26 | parsed = json.loads(request.text)
27 |
28 | city = parsed["results"]["location"]["city"]
29 | country = parsed["results"]["location"]["country"]
30 | timezone = parsed["results"]["location"]["timezone"]
31 | date = parsed["results"]["datetime"][0]["date"]["gregorian"]
32 |
33 | imsak = parsed["results"]["datetime"][0]["times"]["Imsak"]
34 | subuh = parsed["results"]["datetime"][0]["times"]["Fajr"]
35 | zuhur = parsed["results"]["datetime"][0]["times"]["Dhuhr"]
36 | ashar = parsed["results"]["datetime"][0]["times"]["Asr"]
37 | maghrib = parsed["results"]["datetime"][0]["times"]["Maghrib"]
38 | isya = parsed["results"]["datetime"][0]["times"]["Isha"]
39 |
40 | result = (
41 | f"**Jadwal Sholat**:\n"
42 | f"📅 `{date} | {timezone}`\n"
43 | f"🌏 `{city} | {country}`\n\n"
44 | f"**Imsak :** `{imsak}`\n"
45 | f"**Subuh :** `{subuh}`\n"
46 | f"**Zuhur :** `{zuhur}`\n"
47 | f"**Ashar :** `{ashar}`\n"
48 | f"**Maghrib :** `{maghrib}`\n"
49 | f"**Isya :** `{isya}`\n"
50 | )
51 |
52 | await adzan.edit(result)
53 |
54 |
55 | CMD_HELP.update({"adzan": f"\n\n𝙋𝙚𝙧𝙞𝙣𝙩𝙖𝙝: `{cmd}adzan`
40 |
41 |
42 |
43 |
44 | ## ᴏʀɪɢɪɴᴀʟ ʀᴇᴘᴏ & sᴘᴇᴄɪᴀʟ ᴛʜᴀɴᴋs :
45 |
46 | * [Kyy-Userbot](https://github.com/muhammadrizky16/Kyy-Userbot)
47 | * Special Thanks To : [TONIC](https://github.com/Tonic990)
48 | * Special Thanks To : [KYY](https://github.com/muhammadrizky16)
49 | * Thank you to all Indonesian Userbot Developers 🇮🇩
50 |
51 |
--------------------------------------------------------------------------------
/userbot/modules/tags.py:
--------------------------------------------------------------------------------
1 | # Port By @VckyouuBitch From Geez - Project
2 | # Copyright © Geez - Project
3 | # Credits By Ultroid
4 |
5 | from telethon.tl.types import ChannelParticipantAdmin as admin
6 | from telethon.tl.types import ChannelParticipantCreator as owner
7 | from telethon.tl.types import UserStatusOffline as off
8 | from telethon.tl.types import UserStatusOnline as onn
9 | from telethon.tl.types import UserStatusRecently as rec
10 | from telethon.utils import get_display_name
11 |
12 | from userbot.utils import Xa_cmd
13 | from userbot import CMD_HELP, CMD_HANDLER as cmd
14 |
15 |
16 | @Xa_cmd(pattern="tag(on|off|all|bots|rec|admins|owner)?(.*)")
17 | async def _(e):
18 | okk = e.text
19 | lll = e.pattern_match.group(2)
20 | users = 0
21 | o = 0
22 | nn = 0
23 | rece = 0
24 | if lll:
25 | xx = f"{lll}"
26 | else:
27 | xx = ""
28 | async for bb in e.client.iter_participants(e.chat_id, 99):
29 | users = users + 1
30 | x = bb.status
31 | y = bb.participant
32 | if isinstance(x, onn):
33 | o = o + 1
34 | if "on" in okk:
35 | xx += f"\n[{get_display_name(bb)}](tg://user?id={bb.id})"
36 | if isinstance(x, off):
37 | nn = nn + 1
38 | if "off" in okk:
39 | if not (bb.bot or bb.deleted):
40 | xx += f"\n[{get_display_name(bb)}](tg://user?id={bb.id})"
41 | if isinstance(x, rec):
42 | rece = rece + 1
43 | if "rec" in okk:
44 | if not (bb.bot or bb.deleted):
45 | xx += f"\n[{get_display_name(bb)}](tg://user?id={bb.id})"
46 | if isinstance(y, owner):
47 | if "admin" or "owner" in okk:
48 | xx += f"\n👑 [{get_display_name(bb)}](tg://user?id={bb.id}) 👑"
49 | if isinstance(y, admin):
50 | if "admin" in okk:
51 | if not bb.deleted:
52 | xx += f"\n[{get_display_name(bb)}](tg://user?id={bb.id})"
53 | if "all" in okk:
54 | if not (bb.bot or bb.deleted):
55 | xx += f"\n[{get_display_name(bb)}](tg://user?id={bb.id})"
56 | if "bot" in okk:
57 | if bb.bot:
58 | xx += f"\n[{get_display_name(bb)}](tg://user?id={bb.id})"
59 | await e.client.send_message(e.chat_id, xx)
60 | await e.delete()
61 |
62 |
63 | CMD_HELP.update({
64 | 'tags':
65 | f"𝘾𝙤𝙢𝙢𝙖𝙣𝙙: `{cmd}tag all`"
66 | "\n• : Tag Top 100 Members of chat."
67 | f"\n\n𝘾𝙤𝙢𝙢𝙖𝙣𝙙: `{cmd}tag admin`"
68 | "\n• : Tag Admins of that chat."
69 | f"\n\n𝘾𝙤𝙢𝙢𝙖𝙣𝙙: `{cmd}tag owner`"
70 | "\n• : Tag Owner of that chat."
71 | f"\n\n𝘾𝙤𝙢𝙢𝙖𝙣𝙙: `{cmd}tag bot`"
72 | "\n• : Tag Bots of that chat."
73 | f"\n\n𝘾𝙤𝙢𝙢𝙖𝙣𝙙: `{cmd}tag rec`"
74 | "\n• : Tag recently Active Members."
75 | f"\n\n𝘾𝙤𝙢𝙢𝙖𝙣𝙙: `{cmd}tag on`"
76 | "\n• : Tag online Members(work only if privacy off)."
77 | f"\n\n𝘾𝙤𝙢𝙢𝙖𝙣𝙙: `{cmd}tag off`"
78 | "\n• : Tag Offline Members(work only if privacy off)."
79 | })
80 |
--------------------------------------------------------------------------------
/userbot/modules/covid.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2020 The Raphielscape Company LLC.
2 | #
3 | # Licensed under the Raphielscape Public License, Version 1.d (the "License");
4 | # you may not use this file except in compliance with the License.
5 |
6 | from covid import Covid
7 | from userbot import CMD_HELP
8 | from userbot.events import register
9 |
10 |
11 | @register(outgoing=True, pattern="^.covid (.*)")
12 | async def corona(event):
13 | await event.edit("`Processing...`")
14 | country = event.pattern_match.group(1)
15 | covid = Covid(source="worldometers")
16 | country_data = covid.get_status_by_country_name(country)
17 | if country_data:
18 | output_text = f"`⚠️Confirmed : {country_data['confirmed']} (+{country_data['new_cases']})`\n"
19 | output_text += f"`☢️Active : {country_data['active']}`\n"
20 | output_text += f"`🤕Critical : {country_data['critical']}`\n"
21 | output_text += f"`😟New Deaths : {country_data['new_deaths']}`\n\n"
22 | output_text += f"`⚰️Deaths : {country_data['deaths']} (+{country_data['new_deaths']})`\n"
23 | output_text += f"`😔New Cases : {country_data['new_cases']}`\n"
24 | output_text += f"`😇Recovered : {country_data['recovered']}`\n"
25 | output_text += f"`🧪Total tests : {country_data['total_tests']}`\n\n"
26 | output_text += f"Data provided by [Worldometer](https://www.worldometers.info/coronavirus/country/{country})"
27 | else:
28 | output_text = "No information yet about this country!"
29 |
30 | await event.edit(f"`Corona Virus Info in {country}:`\n\n{output_text}")
31 |
32 |
33 | @register(outgoing=True, pattern="^.covid$")
34 | async def corona(event):
35 | await event.edit("`Processing...`")
36 | country = "World"
37 | covid = Covid(source="worldometers")
38 | country_data = covid.get_status_by_country_name(country)
39 | if country_data:
40 | output_text = f"`⚠️Confirmed : {country_data['confirmed']} (+{country_data['new_cases']})`\n"
41 | output_text += f"`☢️Active : {country_data['active']}`\n"
42 | output_text += f"`🤕Critical : {country_data['critical']}`\n"
43 | output_text += f"`😟New Deaths : {country_data['new_deaths']}`\n\n"
44 | output_text += f"`⚰️Deaths : {country_data['deaths']} (+{country_data['new_deaths']})`\n"
45 | output_text += f"`😔New Cases : {country_data['new_cases']}`\n"
46 | output_text += f"`😇Recovered : {country_data['recovered']}`\n"
47 | output_text += "`🧪Total tests : N/A`\n\n"
48 | output_text += f"Data provided by [Worldometer](https://www.worldometers.info/coronavirus/country/{country})"
49 | else:
50 | output_text = "No information yet about this country!"
51 |
52 | await event.edit(f"`Corona Virus Info in {country}:`\n\n{output_text}")
53 |
54 |
55 | CMD_HELP.update({"covid": "`.covid `**