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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
*.pyc
*.ini
*.txt
*.session
*.log
*.pyc
__pycache__/
config.ini
cookies/cookies.txt
commands/sched.py
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ A free and open-source Telegram userbot based on Telethon and fully modular.

## ⚠️ Warnings


> [!WARNING]
> PLEASE NOTE THAT THE USERBOT IS STILL IN BETA STAGE, THIS MEAN THAT BUGS MAY HAPPENS, YOU CAN CONTRIBUTE TO FIX BUGS AND IMPROVE THIS PROJECT

> [!CAUTION]
> USE OF USERBOT ON TELEGRAM IS PROHIBITED AND MAY RESULT IN THE BANNING OF YOUR ACCOUNT. WE DO NOT ASSUME ANY RESPONSIBILITY. THIS PROJECT IS FOR EDUCATIONAL PURPOSES ONLY.

Expand Down Expand Up @@ -44,8 +40,9 @@ We need your help to translate EXEUbot into different languages! If you are flue

## Roadmap

- [x] Multi-Language support (we need translators for other languages)
- [ ] Plugins repository (coming soon)
- [ ] Ability to enable/disable a module from the config.ini file
- [ ] Ability to change commands prefix in config.ini file

## Contributing

Expand Down
10 changes: 8 additions & 2 deletions commands/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@
import speedtest
import platform
import humanize
import os
from telethon import TelegramClient, events
from translations import translations

async def system_info(event):
try:
version_path = os.path.join(os.path.dirname(__file__), "../version.txt")
if os.path.exists(version_path):
with open(version_path, 'r') as version_file:
userbot_version = version_file.read().strip()

cpu_usage = psutil.cpu_percent()
memory = psutil.virtual_memory()

st = speedtest.Speedtest(secure=True)
server = st.get_best_server()
ping = server['latency']
ping = int(server['latency'])

system_info = platform.uname()
python_version = platform.python_version()
Expand All @@ -24,7 +30,7 @@ async def system_info(event):
f"{translations.get('kernel')}: {system_info.release}\n"
f"{translations.get('python_version')}: {python_version}\n"
f"{translations.get('telethon_version')}: {telethon_version}\n"
f"{translations.get('userbot_version')}: Beta 1.20\n"
f"{translations.get('userbot_version')}: {userbot_version}\n"
f"{translations.get('cpu_usage')}: {cpu_usage}%\n"
f"{translations.get('ram_usage')}: {memory.percent}% ({humanize.naturalsize(memory.used)})\n"
f"{translations.get('ram_total')}: {humanize.naturalsize(memory.total)}\n"
Expand Down
47 changes: 0 additions & 47 deletions commands/sched.py

This file was deleted.

11 changes: 7 additions & 4 deletions commands/shorten.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from telethon import TelegramClient, events
import requests
import re
import json
import os
from translations import translations

async def shorten_url(event):

Expand All @@ -14,13 +17,13 @@ async def shorten_url(event):
response = requests.get(api_url)
if response.status_code == 200:
shortened_url = response.text
await event.edit(f"URL shortened with TinyURL: {shortened_url}")
await event.edit(translations["url_shortened"].format(shortened_url=shortened_url))
else:
await event.reply("An error occurred while shortening the URL.")
await event.reply(translations["error_shortening_url"])
except Exception as e:
await event.reply(f"An error occurred: {str(e)}")
await event.reply(translations["error_occurred"].format(error=str(e)))
else:
await event.reply("Please provide a URL to shorten.")
await event.reply(translations["provide_url_to_shorten"])

def register(client):
@client.on(events.NewMessage(pattern=r'^\.short\s+\S+', outgoing=True))
Expand Down
15 changes: 8 additions & 7 deletions commands/timer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import re
import asyncio
import json
from telethon import events
from translations import translations

def register(client):
@client.on(events.NewMessage(pattern=r'^\.timer (\d+)([hms]) (.+)', outgoing=True))
Expand All @@ -9,7 +11,7 @@ async def timer_handler(event):
# Parsing the command
match = re.match(r'^\.timer (\d+)([hms]) (.+)', event.text)
if not match:
await event.reply("Invalid command format. Use `.timer 2m reason`.")
await event.reply(translations["invalid_command_format"])
return

time_value = int(match.group(1))
Expand All @@ -24,25 +26,24 @@ async def timer_handler(event):
elif time_unit == 's':
countdown_time = time_value
else:
await event.reply("Invalid time unit. Use `h`, `m`, or `s`.")
await event.reply(translations["invalid_time_unit"])
return

# Initial message
message = await event.reply(f"⏳ Timer started: {reason}\nRemaining: {countdown_time} seconds.")
message = await event.reply(translations["timer_started"].format(reason=reason, countdown_time=countdown_time))

# Countdown logic
while countdown_time > 0:
countdown_time -= 1
time_display = format_time(countdown_time)
await message.edit(f"⏳ Timer started: {reason}\nRemaining: {time_display}")
await message.edit(translations["timer_running"].format(reason=reason, time_display=time_display))
await asyncio.sleep(1)

# Timer finished
await message.edit(f"✅ Timer finished: {reason}!")
await message.edit(translations["timer_finished"].format(reason=reason))

except Exception as e:
await event.reply(f"Error: {str(e)}")

await event.reply(translations["error_occurred"].format(error=str(e)))
def format_time(seconds):
"""Format seconds into a more readable hh:mm:ss format."""
hours, remainder = divmod(seconds, 3600)
Expand Down
23 changes: 7 additions & 16 deletions translations/de.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,32 @@
{
"// whitelist.py": "Übersetzungen für whitelist.py",
"user_whitelisted": "Der Benutzer {user_id} ist bereits auf der Whitelist.",
"user_added_whitelist": "Benutzer {user_id} zur Whitelist hinzugefügt.",
"user_not_in_whitelist": "Der Benutzer {user_id} ist nicht auf der Whitelist.",
"user_removed_whitelist": "Benutzer {user_id} von der Whitelist entfernt.",
"blocked_reported": "Du wurdest blockiert und wegen Spam gemeldet.",
"warning_message": "Warnung {current_warning}/{warning_count}: Du kannst diesen Benutzer nicht kontaktieren. Bitte höre auf, Nachrichten zu senden, sonst wirst du blockiert.",
"// infouser.py": "Übersetzungen für infouser.py",
"command_in_groups_only": "Dieser Befehl funktioniert nur in Gruppen.",
"mention_or_reply_user": "Du musst auf die Nachricht eines Benutzers antworten oder den Benutzer erwähnen, um diesen Befehl zu verwenden.",
"about_user": "Informationen über {first_name}:",
"user_id": "ID: {user_id}",
"user_name": "Name: {first_name} {last_name}",
"user_username": "Benutzername: @{username}",
"user_datacenter": "Rechenzentrum: {datacenter}",
"// leave.py": "Übersetzungen für leave.py",
"left_group": "Ich habe die Gruppe verlassen.",
"command_groups_only": "Dieser Befehl kann nur in Gruppen verwendet werden.",
"// main.py": "Übersetzungen für main.py",
"userbot_started": "Userbot gestartet!",
"userbot_disconnected_cancelled_error": "Userbot wegen einer CancelledError-Ausnahme getrennt.",
"error_occurred": "Ein Fehler ist aufgetreten: {error}",
"abort_signal_received": "Abbruchsignal erhalten. Userbot wird geschlossen…",
"// video_downloader.py": "Übersetzungen für video_downloader.py",
"video": "Video: '{video_title}'",
"video_downloaded_successfully": "Video '{video_title}' erfolgreich heruntergeladen! Senden…",
"error_downloading_video": "Fehler beim Herunterladen des Videos: {error}",
"// copy.py": "Übersetzungen für copy.py",
"copy_successfully": "Konto erfolgreich geklont",
"// dellog.py": "Übersetzungen für dellog.py",
"dellog_successfully": "Die Protokolldatei wurde erfolgreich gelöscht.",
"dellog_missing": "Die Protokolldatei fehlt.",
"// dm.py": "Übersetzungen für dm.py",
"provide_username_dm": "Bitte gib einen Benutzernamen und eine Nachricht an.",
"user_not_found": "Benutzer nicht gefunden, bitte gib einen gültigen Benutzernamen an.",
"message_sent": "Nachricht an @{username} gesendet!",
"// info.py": "Übersetzungen für info.py",
"system_info_title": "ℹ️ Systeminformationen:",
"os": "💻 OS",
"kernel": "🔳 Kernel",
Expand All @@ -46,17 +37,14 @@
"ram_usage": "📈 RAM-Auslastung",
"ram_total": "📉 Gesamter RAM",
"ping": "📶 Ping",
"userbot_commands_link": "🤖 [Userbot-Befehle](https://telegra.ph/Userbot-commands-09-11-46)",
"userbot_commands_link": "🤖 [Userbot-Befehle](https://github.com/EXE-Official/EXEUbot/wiki/Commands)",
"userbot_created_by": "👤 Userbot erstellt von Elxes ©️",
"// delall.py": "Übersetzungen für delall.py",
"floodwait_error": "Das Konto ist im Floodwait. Warte {waitingtime} Sekunden…",
"// backup.py": "Übersetzungen für backup.py",
"backup_complete": "Informationssicherung abgeschlossen!",
"backup_error": "Beim Sichern ist ein Fehler aufgetreten: {error}",
"no_backup_files": "Keine Sicherungsdateien gefunden.",
"restore_complete": "Wiederherstellung abgeschlossen!",
"restore_error": "Beim Wiederherstellen ist ein Fehler aufgetreten: {error}",
"// weather.py": "Übersetzungen für weather.py",
"ask_city": "Bitte geben Sie den Namen einer Stadt an.",
"city_not_found": "Stadt nicht gefunden, bitte überprüfen Sie den Namen und versuchen Sie es erneut.",
"weather_in": "Wetter in",
Expand All @@ -65,9 +53,12 @@
"wind_speed": "🌬️ Windgeschwindigkeit",
"description": "🔍 Beschreibung",
"pressure": "🔵 Druck",
"// timer.py": "Übersetzungen für timer.py",
"timer_started": "⏳ Timer gestartet: {reason}\nVerbleibend: {countdown_time} Sekunden.",
"timer_running": "⏳ Timer gestartet: {reason}\nVerbleibend: {time_display}",
"timer_finished": "✅ Timer beendet: {reason}!"

"timer_finished": "✅ Timer beendet: {reason}!",
"url_shortened": "URL mit TinyURL verkürzt: {shortened_url}",
"error_shortening_url": "Beim Verkürzen der URL ist ein Fehler aufgetreten.",
"provide_url_to_shorten": "Bitte geben Sie eine URL zum Verkürzen an.",
"invalid_time_format": "Ungültiges Zeitformat. Verwenden Sie Xs, Xm oder Xh.",
"schedule_message_success": "Ich werde '{text}' alle {time_str} in diesem Chat posten. Um abzubrechen, verwenden Sie .cancsched"
}
23 changes: 7 additions & 16 deletions translations/en.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,32 @@
{
"// whitelist.py": "Translations for whitelist.py",
"user_whitelisted": "User {user_id} is already in the whitelist.",
"user_added_whitelist": "User {user_id} added to whitelist.",
"user_not_in_whitelist": "User {user_id} is not in the whitelist.",
"user_removed_whitelist": "User {user_id} removed from whitelist.",
"blocked_reported": "You have been blocked and reported for spamming.",
"warning_message": "Warning {current_warning}/{warning_count}: You can't contact this user. Please stop sending messages, otherwise you'll get blocked.",
"// infouser.py": "Translations for infouser.py",
"command_in_groups_only": "This command only works in groups.",
"mention_or_reply_user": "You must reply to a user's message or mention the user to use this command.",
"about_user": "About {first_name}:",
"user_id": "ID: {user_id}",
"user_name": "Name: {first_name} {last_name}",
"user_username": "Username: @{username}",
"user_datacenter": "Datacenter: {datacenter}",
"// leave.py": "Translations for leave.py",
"left_group": "I left the group.",
"command_groups_only": "This command can only be used in groups.",
"// main.py": "Translations for main.py",
"userbot_started": "Userbot started!",
"userbot_disconnected_cancelled_error": "Userbot disconnected due to a CancelledError exception.",
"error_occurred": "An error occurred: {error}",
"abort_signal_received": "Abort signal received. Closing the Userbot…",
"// video_downloader.py": "Translations for video_downloader.py",
"video": "Video: '{video_title}'",
"video_downloaded_successfully": "Video '{video_title}' downloaded successfully! Sending…",
"error_downloading_video": "Error downloading video: {error}",
"// copy.py": "Translations for copy.py",
"copy_successfully": "Account successfully cloned",
"// dellog.py": "Translations for dellog.py",
"dellog_successfully": "The log file has been successfully deleted.",
"dellog_missing": "The log file is missing.",
"// dm.py": "Translations for dm.py",
"provide_username_dm": "Please, provide a username and a message.",
"user_not_found": "Failed to find a user. Please provide a valid username.",
"message_sent": "Message sent to @{username}!",
"// info.py": "Translations for info.py",
"system_info_title": "ℹ️ System info:",
"os": "💻 OS",
"kernel": "🔳 Kernel",
Expand All @@ -46,17 +37,14 @@
"ram_usage": "📈 RAM usage",
"ram_total": "📉 RAM total",
"ping": "📶 Ping",
"userbot_commands_link": "🤖 [Userbot Commands](https://telegra.ph/Userbot-commands-09-11-46)",
"userbot_commands_link": "🤖 [Userbot Commands](https://github.com/EXE-Official/EXEUbot/wiki/Commands)",
"userbot_created_by": "👤 Userbot created by Elxes ©️",
"// delall.py": "Translations for delall.py",
"floodwait_error": "Account is in floodwait. Waiting for {waitingtime} seconds…",
"// backup.py": "Translations for backup.py",
"backup_complete": "Information backup complete!",
"backup_error": "An error occurred during backup: {error}",
"no_backup_files": "No backup files found.",
"restore_complete": "Restore complete!",
"restore_error": "An error occurred while restoring: {error}",
"// weather.py": "Translations for weather.py",
"ask_city": "Please specify a city name.",
"city_not_found": "City not found, please check the name and try again.",
"weather_in": "Weather in",
Expand All @@ -65,9 +53,12 @@
"wind_speed": "🌬️ Wind Speed",
"description": "🔍 Description",
"pressure": "🔵 Pressure",
"// timer.py": "Translations for timer.py",
"timer_started": "⏳ Timer started: {reason}\nRemaining: {countdown_time} seconds.",
"timer_running": "⏳ Timer started: {reason}\nRemaining: {time_display}",
"timer_finished": "✅ Timer finished: {reason}!"

"timer_finished": "✅ Timer finished: {reason}!",
"url_shortened": "URL shortened with TinyURL: {shortened_url}",
"error_shortening_url": "An error occurred while shortening the URL.",
"provide_url_to_shorten": "Please provide a URL to shorten.",
"invalid_time_format": "Invalid time format. Use Xs, Xm or Xh.",
"schedule_message_success": "I will post '{text}' every {time_str} in this chat. To cancel, use .cancsched"
}
Loading
Loading