Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,10 @@
[![LICENSE](https://img.shields.io/github/license/kastaid/getter)](LICENSE)
![Version](https://img.shields.io/github/manifest-json/v/kastaid/getter?label=Version)

## Disclaimer

⚠️ **Important:** Your Telegram account may get banned. We are not responsible for any misuse of this userbot.

If you spam, face issues with Telegram, or get your account deleted, **DON’T BLAME US!**
- No personal support.
- We won’t spoon-feed you.
- If you need help, ask in our support group, and we or others will try to help you.
- **DWYOR** (Do With Your Own Risk).

Review the [Telegram API Terms of Service](https://core.telegram.org/api/terms).

Thank you for trusting and using this userbot!
> [!WARNING]
> Your Telegram account may get banned if this userbot is misused. We are not responsible for any spam, violations, or account restrictions.
>
> Use it at your own risk and review the [Telegram API Terms](https://core.telegram.org/api/terms).

## Table of Contents

Expand All @@ -42,7 +33,7 @@ Thank you for trusting and using this userbot!
## Requirements

- Python 3.13+
- Linux (recommended: latest Debian/Ubuntu)
- Linux (Debian/Ubuntu)
- Telegram `API_ID` and `API_HASH` from [API development tools](https://my.telegram.org)

## Quick Start
Expand Down Expand Up @@ -115,25 +106,25 @@ Deploy to Heroku with one click:

Once successfully deployed, test your getter by sending `.ping` in any chat.

**Command prefix:**
**Command prefix**:

- Default prefix is `.` (dot)
- If you set a custom `HANDLER` in your [config](#config), use that prefix instead (e.g., `!ping`, `/ping`)
- If `NO_HANDLER` is set to `True`, send commands without any prefix (e.g., `ping`)

**Get all commands:** `.help` - This will show you all available plugins, commands, and how to use them.
**Get all commands**: `.help` - This will show you all available plugins, commands, and how to use them.

## Custom Plugins

Create custom plugins at `./getter/plugins/custom/plugin_name.py`.

**Dynamic plugin management:**
**Dynamic plugin management**:

- Upload your `plugin_name.py` file anywhere in Telegram (plugin name must be unique)
- Reply to the file with `.load` to download, activate, or update the plugin
- Reply to the plugin file with `.unload [plugin_name]` to remove it

**Example plugin:**
**Example plugin**:

```python
from . import kasta_cmd
Expand Down
2 changes: 1 addition & 1 deletion getter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import sys
from asyncio import set_event_loop
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures.thread import ThreadPoolExecutor
from pathlib import Path
from platform import python_version
from shutil import rmtree
Expand Down
38 changes: 19 additions & 19 deletions getter/core/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,30 +182,30 @@ async def wrapper(kst: Message) -> Callable:
else:
chat_type = "channel"
ftext = r"\\<b>#Getter_Error</b>// Forward this to @kastaot"
ftext += "\n\n<b>Getter Version:</b> <code>" + str(__version__)
ftext += "</code>\n<b>Python Version:</b> <code>" + str(__pyversion__)
ftext += "</code>\n<b>Telethon Version:</b> <code>" + str(__tlversion__)
ftext += "</code>\n<b>Telegram Layer:</b> <code>" + str(__layer__) + "</code>\n\n"
ftext += "\n\n<b>Getter Version</b>: <code>" + str(__version__)
ftext += "</code>\n<b>Python Version</b>: <code>" + str(__pyversion__)
ftext += "</code>\n<b>Telethon Version</b>: <code>" + str(__tlversion__)
ftext += "</code>\n<b>Telegram Layer</b>: <code>" + str(__layer__) + "</code>\n\n"
ftext += "<b><u>START GETTER ERROR LOG</u></b>"
ftext += "\n\n<b>Date:</b> <code>" + date
ftext += "</code>\n<b>Chat Type:</b> <code>" + chat_type
ftext += "</code>\n<b>Chat ID:</b> <code>" + str(chat_id)
ftext += "</code>\n<b>Chat Title:</b> <code>" + normalize(display_name(chat)).upper()
ftext += "</code>\n<b>User ID:</b> <code>" + str(myself)
ftext += "</code>\n<b>Is Dev:</b> <code>" + str(kst.is_dev)
ftext += "</code>\n<b>Is Sudo:</b> <code>" + str(kst.is_sudo)
ftext += "</code>\n<b>Replied:</b> <code>" + str(kst.is_reply)
ftext += "</code>\n<b>Message ID:</b> <code>" + str(kst.reply_to_msg_id or kst.id)
ftext += "</code>\n<b>Message Link:</b> " + str(kst.msg_link)
ftext += "\n\n<b>Event Trigger:</b>\n<code>"
ftext += "\n\n<b>Date</b>: <code>" + date
ftext += "</code>\n<b>Chat Type</b>: <code>" + chat_type
ftext += "</code>\n<b>Chat ID</b>: <code>" + str(chat_id)
ftext += "</code>\n<b>Chat Title</b>: <code>" + normalize(display_name(chat)).upper()
ftext += "</code>\n<b>User ID</b>: <code>" + str(myself)
ftext += "</code>\n<b>Is Dev</b>: <code>" + str(kst.is_dev)
ftext += "</code>\n<b>Is Sudo</b>: <code>" + str(kst.is_sudo)
ftext += "</code>\n<b>Replied</b>: <code>" + str(kst.is_reply)
ftext += "</code>\n<b>Message ID</b>: <code>" + str(kst.reply_to_msg_id or kst.id)
ftext += "</code>\n<b>Message Link</b>: " + str(kst.msg_link)
ftext += "\n\n<b>Event Trigger</b>:\n<code>"
ftext += str(kst.text)
ftext += "</code>\n\n<b>Traceback Info:</b>\n<pre>"
ftext += "</code>\n\n<b>Traceback Info</b>:\n<pre>"
ftext += str(format_exc()).strip()
ftext += "</pre>\n\n<b>Error Text:</b>\n<code>"
ftext += "</pre>\n\n<b>Error Text</b>:\n<code>"
ftext += str(sys.exc_info()[1]).strip()
ftext += "</code>\n\n<b><u>END GETTER ERROR LOG</u></b>"
if not Var.DEV_MODE:
ftext += "\n\n<b>Last 5 Commits:</b>\n<pre>"
ftext += "\n\n<b>Last 5 Commits</b>:\n<pre>"
stdout, stderr, _, _ = await Runner('git log --pretty=format:"%an: %s" -5')
result = stdout + stderr
ftext += result + "</pre>"
Expand Down Expand Up @@ -234,7 +234,7 @@ async def wrapper(kst: Message) -> Callable:
)
if kst.out and BOTLOGS and error_log:
text = r"\\<b>#Getter_Error</b>//"
text += "\n<b>An error details:</b> {}"
text += "\n<b>An error details</b>: {}"
if kst.is_private:
text = text.format(error_log.msg_link)
else:
Expand Down
30 changes: 15 additions & 15 deletions getter/core/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,28 @@
<b><u>IF IGNORED THIS MESSAGE THE BOT WILL NOT WORK</u></b>


<b>Chat ID:</b> <code>{}</code>
<b>Your ID:</b> <code>{}</code>
<b>Chat ID</b>: <code>{}</code>
<b>Your ID</b>: <code>{}</code>

<b>Our Channel:</b> @kastaid
<b>Our Channel</b>: @kastaid
"""
_restart_text = r"""
\\**#Getter**// **is back and alive!**
├ **Sudo:** `{}`
├ **PM-Guard:** `{}`
├ **PM-Logs:** `{}`
├ **PM-Block:** `{}`
├ **Anti-PM:** `{}`
└ **Version:** `{}`
├ **Sudo**: `{}`
├ **PM-Guard**: `{}`
├ **PM-Logs**: `{}`
├ **PM-Block**: `{}`
├ **Anti-PM**: `{}`
└ **Version**: `{}`
"""
_reboot_text = r"""
\\**#Getter**// **is rebooted and applied!**
├ **Sudo:** `{}`
├ **PM-Guard:** `{}`
├ **PM-Logs:** `{}`
├ **PM-Block:** `{}`
├ **Anti-PM:** `{}`
└ **Version:** `{}`
├ **Sudo**: `{}`
├ **PM-Guard**: `{}`
├ **PM-Logs**: `{}`
├ **PM-Block**: `{}`
├ **Anti-PM**: `{}`
└ **Version**: `{}`
"""


Expand Down
12 changes: 6 additions & 6 deletions getter/plugins/_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

gbanned_text = r"""
\\<b>#GBanned_Watch</b>// User {} joined and quickly banned!
<b>Reported:</b> <code>{}</code>
<b>Reason:</b> {}
<b>Reported</b>: <code>{}</code>
<b>Reason</b>: {}
"""
gmuted_text = r"""
\\<b>#GMuted_Watch</b>// User {} joined and quickly muted!
<b>Reason:</b> {}
<b>Reason</b>: {}
"""
_WATCHER_SEM = asyncio.Semaphore(2)

Expand Down Expand Up @@ -101,8 +101,8 @@ async def JoinedHandler(kst):
await ga.edit_permissions(chat.id, user.id, view_messages=False)
except BaseException:
pass
logs_text += f"<b>Reported:</b> <code>{humanbool(is_reported)}</code>\n"
logs_text += "<b>Reason:</b> {}\n".format(f"<pre>{gban.reason}</pre>" if gban.reason else "None given.")
logs_text += f"<b>Reported</b>: <code>{humanbool(is_reported)}</code>\n"
logs_text += "<b>Reason</b>: {}\n".format(f"<pre>{gban.reason}</pre>" if gban.reason else "None given.")
await sendlog(logs_text)

gmute = await is_gmute(user.id, use_cache=True)
Expand All @@ -122,5 +122,5 @@ async def JoinedHandler(kst):
await ga.edit_permissions(chat.id, user.id, send_messages=False)
except BaseException:
pass
logs_text += "<b>Reason:</b> {}\n".format(f"<pre>{gban.reason}</pre>" if gban.reason else "None given.")
logs_text += "<b>Reason</b>: {}\n".format(f"<pre>{gban.reason}</pre>" if gban.reason else "None given.")
await sendlog(logs_text)
34 changes: 17 additions & 17 deletions getter/plugins/admintools.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def _(kst):
text = "{} banned and {} reported!{}".format(
mentionuser(user.id, display_name(user), width=15, html=True),
"was" if is_reported else "not",
f"\n<b>Reason:</b> <pre>{reason}</pre>" if reason else "",
f"\n<b>Reason</b>: <pre>{reason}</pre>" if reason else "",
)
await yy.eor(text, parse_mode="html")
except Exception as err:
Expand Down Expand Up @@ -102,7 +102,7 @@ async def _(kst):
text = "{} dbanned and {} reported!{}".format(
mentionuser(user.id, display_name(user), width=15, html=True),
"was" if is_reported else "not",
f"\n<b>Reason:</b> <pre>{reason}</pre>" if reason else "",
f"\n<b>Reason</b>: <pre>{reason}</pre>" if reason else "",
)
await yy.eor(text, parse_mode="html")
except Exception as err:
Expand Down Expand Up @@ -168,10 +168,10 @@ async def _(kst):
until_date, duration = until_time(timing[:-1], timing[-1])
try:
await ga.edit_permissions(chat_id, user.id, until_date=until_date, view_messages=False)
text = "{} temporarily banned!\n<b>Duration:</b> {}{}".format(
text = "{} temporarily banned!\n<b>Duration</b>: {}{}".format(
mentionuser(user.id, display_name(user), width=15, html=True),
f"{timing[:-1]} {duration}",
f"\n<b>Reason:</b> <pre>{reason}</pre>" if reason else "",
f"\n<b>Reason</b>: <pre>{reason}</pre>" if reason else "",
)
await yy.eor(text, parse_mode="html")
except Exception as err:
Expand All @@ -196,7 +196,7 @@ async def _(kst):
await ga.edit_permissions(chat_id, user.id)
text = "{} unbanned!{}".format(
mentionuser(user.id, display_name(user), width=15, html=True),
f"\n<b>Reason:</b> <pre>{reason}</pre>" if reason else "",
f"\n<b>Reason</b>: <pre>{reason}</pre>" if reason else "",
)
await yy.eor(text, parse_mode="html")
except Exception as err:
Expand All @@ -223,7 +223,7 @@ async def _(kst):
await ga.edit_permissions(chat_id, user.id, send_messages=False)
text = "{} muted!{}".format(
mentionuser(user.id, display_name(user), width=15, html=True),
f"\n<b>Reason:</b> <pre>{reason}</pre>" if reason else "",
f"\n<b>Reason</b>: <pre>{reason}</pre>" if reason else "",
)
await yy.eor(text, parse_mode="html")
except Exception as err:
Expand Down Expand Up @@ -253,7 +253,7 @@ async def _(kst):
await reply.try_delete()
text = "{} dmuted!{}".format(
mentionuser(user.id, display_name(user), width=15, html=True),
f"\n<b>Reason:</b> <pre>{reason}</pre>" if reason else "",
f"\n<b>Reason</b>: <pre>{reason}</pre>" if reason else "",
)
await yy.eor(text, parse_mode="html")
except Exception as err:
Expand Down Expand Up @@ -306,10 +306,10 @@ async def _(kst):
until_date, duration = until_time(timing[:-1], timing[-1])
try:
await ga.edit_permissions(chat_id, user.id, until_date=until_date, send_messages=False)
text = "{} temporarily muted!\n<b>Duration:</b> {}{}".format(
text = "{} temporarily muted!\n<b>Duration</b>: {}{}".format(
mentionuser(user.id, display_name(user), width=15, html=True),
f"{timing[:-1]} {duration}",
f"\n<b>Reason:</b> <pre>{reason}</pre>" if reason else "",
f"\n<b>Reason</b>: <pre>{reason}</pre>" if reason else "",
)
await yy.eor(text, parse_mode="html")
except Exception as err:
Expand All @@ -336,7 +336,7 @@ async def _(kst):
await ga.edit_permissions(chat_id, user.id, send_messages=True)
text = "{} unmuted!{}".format(
mentionuser(user.id, display_name(user), width=15, html=True),
f"\n<b>Reason:</b> <pre>{reason}</pre>" if reason else "",
f"\n<b>Reason</b>: <pre>{reason}</pre>" if reason else "",
)
await yy.eor(text, parse_mode="html")
except Exception as err:
Expand All @@ -363,7 +363,7 @@ async def _(kst):
await ga.kick_participant(chat_id, user.id)
text = "{} kicked!{}".format(
mentionuser(user.id, display_name(user), width=15, html=True),
f"\n<b>Reason:</b> <pre>{reason}</pre>" if reason else "",
f"\n<b>Reason</b>: <pre>{reason}</pre>" if reason else "",
)
await yy.eor(text, parse_mode="html")
except Exception as err:
Expand Down Expand Up @@ -393,7 +393,7 @@ async def _(kst):
await reply.try_delete()
text = "{} dkicked!{}".format(
mentionuser(user.id, display_name(user), width=15, html=True),
f"\n<b>Reason:</b> <pre>{reason}</pre>" if reason else "",
f"\n<b>Reason</b>: <pre>{reason}</pre>" if reason else "",
)
await yy.eor(text, parse_mode="html")
except Exception as err:
Expand Down Expand Up @@ -593,7 +593,7 @@ async def _(kst):
btn = "Go to message..."
pinned += f"{count}. <a href=https://t.me/c/{chat_id}/{x.id}>{btn}</a>\n"
count += 1
text = f"<b>Pinned message(s) in {normalize(title).lower()}:</b>\n"
text = f"<b>Pinned message(s) in {normalize(title).lower()}</b>:\n"
if not pinned:
return await yy.eor("`No Pinned!`", time=5)
await yy.eor(text + pinned, parts=True, parse_mode="html")
Expand Down Expand Up @@ -853,7 +853,7 @@ async def _(kst):
chat = await kst.get_chat()
yy = await kst.eor("`Processing...`")
total = 0
text = f"<b>Admins in {normalize(chat.title).lower()}:</b>\n"
text = f"<b>Admins in {normalize(chat.title).lower()}</b>:\n"
async for x in ga.iter_participants(
chat,
filter=typ.ChannelParticipantsAdmins,
Expand All @@ -876,12 +876,12 @@ async def _(kst):
"{i}ban [reply]/[username/mention/id] [reason]": "Ban user and report them as spam.",
"{i}dban [reply] [reason]": "Ban user by reply, delete their message and report them as spam.",
"{i}sban [reply]/[username/mention/id]": "Silently a ban user, delete my message and report them as spam.",
"{i}tban [reply]/[username/mention/id] [timing] [reason]": "Temporarily ban user. **timing:** 4m = 4 minutes, 3h = 3 hours, 6d = 6 days.",
"{i}tban [reply]/[username/mention/id] [timing] [reason]": "Temporarily ban user. **timing**: 4m = 4 minutes, 3h = 3 hours, 6d = 6 days.",
"{i}unban [reply]/[username/mention/id] [reason]": "Unbanned user.",
"{i}mute [reply]/[username/mention/id] [reason]": "Mute user.",
"{i}dmute [reply] [reason]": "Mute user by reply, and delete their message.",
"{i}smute [reply]/[username/mention/id]": "Silently mute user, and delete my message.",
"{i}tmute [reply]/[username/mention/id] [timing] [reason]": "Temporarily mute user. **timing:** 4m = 4 minutes, 3h = 3 hours, 6d = 6 days.",
"{i}tmute [reply]/[username/mention/id] [timing] [reason]": "Temporarily mute user. **timing**: 4m = 4 minutes, 3h = 3 hours, 6d = 6 days.",
"{i}unmute [reply]/[username/mention/id] [reason]": "Unmute user.",
"{i}kick [reply]/[username/mention/id] [reason]": "Kick user.",
"{i}dkick [reply] [reason]": "Kick user by reply, and delete their message.",
Expand All @@ -901,7 +901,7 @@ async def _(kst):
"{i}unbanall": "Unban all banned users.",
"{i}adminlist": """Get list all admins by type in current group.

**Examples:**
**Examples**:
- Mute user for two hours.
-> `{i}tmute @username 2h abuse`

Expand Down
6 changes: 3 additions & 3 deletions getter/plugins/afk.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async def _(kst):
text = "<b><u>I’m now AFK!</u></b>"
if reason:
reason = escape(reason)
text += f"\n<b>Reason:</b> <pre>{reason}</pre>"
text += f"\n<b>Reason</b>: <pre>{reason}</pre>"
await add_afk(reason, start)
getter_app.add_handler(
StopAFK,
Expand Down Expand Up @@ -113,7 +113,7 @@ async def OnAFK(kst):
text = "<b><u>I’m on AFK!</u></b>\n"
text += f"Last seen {afk_time} ago."
reason = f"<pre>{afk.reason}</pre>" if afk.reason else "No reason."
text += f"\n<b>Reason:</b> {reason}"
text += f"\n<b>Reason</b>: {reason}"
chat_id = str(kst.chat_id)
if chat_id in afk.last:
try:
Expand Down Expand Up @@ -151,7 +151,7 @@ async def handle_afk() -> None:
"{i}afk [reason]/[reply]": "When you are in AFK if anyone tags you then will notify them if you're AFK unless if 'afk' or 'brb' words is exists!",
"brb": """Alias for afk command, without handler!

**Note:**
**Notes**:
- AFK is abbreviation for “Away From Keyboard”.
- BRB also abbreviation for “Be Right Back”.
- To stopping AFK just typing at anywhere.
Expand Down
4 changes: 2 additions & 2 deletions getter/plugins/beautify.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ async def _(kst):
pattern="theme$",
)
async def _(kst):
carbon = f"**{len(CARBON_PRESETS)} Carbon Themes:**\n" + "\n".join([f"- `{_}`" for _ in CARBON_PRESETS])
rayso = f"**{len(RAYSO_THEMES)} Rayso Themes:**\n" + "\n".join([f"- `{_}`" for _ in RAYSO_THEMES])
carbon = f"**{len(CARBON_PRESETS)} Carbon Themes**:\n" + "\n".join([f"- `{_}`" for _ in CARBON_PRESETS])
rayso = f"**{len(RAYSO_THEMES)} Rayso Themes**:\n" + "\n".join([f"- `{_}`" for _ in RAYSO_THEMES])
await kst.sod(carbon)
await kst.sod(rayso)

Expand Down
2 changes: 1 addition & 1 deletion getter/plugins/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def _(kst):
pattern="(uptime|up)$",
)
async def _(kst):
await kst.eod(f"**Uptime:** {kst.client.uptime}")
await kst.eod(f"**Uptime**: {kst.client.uptime}")


@kasta_cmd(
Expand Down
Loading
Loading