Skip to content
Merged

Beta #88

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
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
name: "CodeQL"

on:
push:
push:
branches: [ master ]
pull_request:
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
schedule:
- cron: '32 13 * * 0'

jobs:
Expand Down
140 changes: 72 additions & 68 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,71 +1,75 @@
{
"name": "Trôn",
"description": "Tron Is A Multifunctional Telegram Userbot with Custom Settings.",
"logo": "https://telegra.ph/file/8d62a8fe005a8077188ec.jpg",
"keywords": [
"userbot",
"plugins",
"development",
"tools",
"pyrogram",
"productivity"
],
"repository": "https://github.com/beastzx18/Tron/",
"website": "https://t.me/tronuserbot",
"success_url": "/welcome",
"env": {
"API_ID": {
"description": "Login here -> my.telegram.org to get pair of keys",
"value": "",
"required": true
},
"API_HASH": {
"description": "Again You Will Find This Here -> my.telegram.org",
"value": "",
"required": true
},
"SESSION": {
"description": "Visit here & create https://replit.com/@vs423502/Tron-Session?v=1",
"value": "",
"required": true
},
"PREFIX": {
"description": "This Is The Handle Of Your All Commands You Can Change It To -> [ . , ? ' / + - * ] Any Symbol That You Like.",
"value": ".",
"required": true
},
"HEROKU_API_KEY": {
"description": "Your heroku api key, Go To Heroku >> Profile Icon >> Account settings >> Scroll Down >> Reveal >> Copy.",
"value": "",
"required": true
},
"HEROKU_APP_NAME": {
"description": "Your Heroku app name, Look Top First Slot You Have Just Filled At The Top, That's The Value.",
"value": "",
"required": true
},
"TIME_ZONE": {
"description": "For Time Plugin. Change It To Your Time Zone or If You Don't Know Leave As it is.",
"value": "Asia/Kolkata",
"required": true
},
"LOG_CHAT": {
"description": "A Private Telegram Group Id To Store Your Logs.",
"required": true
},
"TOKEN": {
"description": "Go to @botfather in telegram and make a new bot and get the bot token.",
"required": true
}
},
"addons": [{
"plan": "heroku-postgresql",
"options": {
"version": "12"
}
}],
"buildpacks": [{
"url": "heroku/python"
}]
"name": "Trôn",
"description": "Tron Is A Multifunctional Telegram Userbot with Custom Settings.",
"logo": "https://telegra.ph/file/8d62a8fe005a8077188ec.jpg",
"keywords": [
"userbot",
"plugins",
"development",
"tools",
"pyrogram",
"productivity"
],
"repository": "https://github.com/beastzx18/Tron/",
"website": "https://t.me/tronuserbot",
"success_url": "/welcome",
"env": {
"API_ID": {
"description": "Login here -> my.telegram.org to get pair of keys",
"value": "",
"required": true
},
"API_HASH": {
"description": "Again You Will Find This Here -> my.telegram.org",
"value": "",
"required": true
},
"SESSION": {
"description": "Visit here & create https://replit.com/@beastzx18/Tronuserbot-session",
"value": "",
"required": true
},
"PREFIX": {
"description": "This Is The Handler Of Your All Commands You Can Change It To -> [ . , ? ' / + - * ] Any Symbol That You Like.",
"value": ".",
"required": true
},
"HEROKU_API_KEY": {
"description": "Your heroku api key, Go To Heroku >> Profile Icon >> Account settings >> Scroll Down >> Reveal >> Copy.",
"value": "",
"required": true
},
"HEROKU_APP_NAME": {
"description": "Your Heroku app name, Look Top First Slot You Have Just Filled At The Top, That's The Value.",
"value": "",
"required": true
},
"TIME_ZONE": {
"description": "For Time Plugin. Change It To Your Time Zone or If You Don't Know Leave As it is.",
"value": "Asia/Kolkata",
"required": true
},
"LOG_CHAT": {
"description": "A Private Telegram Group Id To Store Your Logs.",
"required": true
},
"TOKEN": {
"description": "Go to @botfather in telegram and make a new bot and get the bot token.",
"required": true
}
},
"addons": [
{
"plan": "heroku-postgresql",
"options": {
"version": "12"
}
}
],
"buildpacks": [
{
"url": "heroku/python"
}
]
}

2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
theme: jekyll-theme-modernist
theme: jekyll-theme-modernist
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Welcome to tron

Everything that you want to know about tron is given here.
Here the information about tron is given, it is always updated if any changes are made in tronuserbot.

### Introduction

Expand All @@ -16,7 +16,7 @@ I have provided a inline help menu to make it easy for the beginners to look for

### Deployment

Tue userbot can be deployed in heroku, it is also deployable by localhost methods.
The userbot can be deployed in heroku, it is also deployable by localhost methods you can do this only if you download and install all the packages from requirements.txt file.


### Contact me
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyrogram
pyrogram==1.4.7
pytube
telegraph
heroku3
Expand Down
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.9.5
python-3.9.5
10 changes: 1 addition & 9 deletions tronx/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
# Files location

* database/postgres
* helpers
* methods/decorators
* modules
* plugins
* ____init____.py
* ____main____.py
### This directory stores all the necessary files which are needed to run the bot, deleting or altering any of the file will give error.
21 changes: 12 additions & 9 deletions tronx/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ async def start_assistant():
this function starts the pyrogram bot client.
"""
if app.bot:
print("Activating assistant.\n")
await app.bot.start()
app.log.info("Assistant activated, startup in progress . . .\n")
print("Assistant activated.\n")
else:
app.log.info("Assistant start unsuccessful, please check that you have given the bot token.\n")
app.log.info("skipping assistant start !")
print("Assistant start unsuccessful, please check that you have given the bot token.\n")
print("skipping assistant start !")



Expand All @@ -27,11 +28,12 @@ async def start_userbot():
this function starts the pyrogram userbot client.
"""
if app:
print("Activating userbot.\n")
await app.start()
app.log.info("Userbot activated, startup in progress . . .\n")
print("Userbot activated.\n")
else:
app.log.info("Userbot startup unsuccessful, please check everything again ...")
app.log.info("Couldn't load modules of userbot")
print("Userbot startup unsuccessful, please check everything again ...")
print("Couldn't load modules of userbot")



Expand All @@ -42,14 +44,15 @@ async def start_bot():
clients custom 'import_module' to start clients & import modules.
"""
print("___________________________________. Welcome to Tron corporation .___________________________________\n\n\n")
print("PLUGINS: Installing . . .\n\n")
print("PLUGINS: Installing.\n\n")
plugins = app.import_module("tronx/plugins/", exclude=app.NoLoad())
print(f"\n\n{plugins} plugins Loaded\n\n")
print("MODULES: Installing . . .\n\n")
print("MODULES: Installing.\n\n")
modules = app.import_module("tronx/modules/", exclude=app.NoLoad())
print(f"\n\n{modules} modules Loaded")
print(f"\n\n{modules} modules Loaded\n\n")
await start_assistant()
await start_userbot()
print("You successfully deployed Tronuserbot, try .ping or .alive to test it.")
await idle() # block execution


Expand Down
9 changes: 5 additions & 4 deletions tronx/clients/utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import os
import time
import pyrogram
import platform

from logging import getLogger, WARNING
from pysimplelog import Logger
from config import Config
from typing import Union, List
from telegraph import Telegraph
from tronx.methods import Methods
from pyrogram import __version__ as pyro_version
from pyrogram.types import Message
from pyrogram.errors import PeerIdInvalid
from tronx.database import Database
from tronx.helpers import Helpers

Expand All @@ -22,7 +21,7 @@ class Utils(Methods, Config, Database, Helpers):
userbot_version = "v.0.0.5"
assistant_version = "v.0.0.1"
python_version = str(platform.python_version())
pyrogram_version = str(pyrogram.__version__)
pyrogram_version = str(pyro_version)

# containers /

Expand All @@ -41,7 +40,9 @@ class Utils(Methods, Config, Database, Helpers):

# debugging /

getLogger("pyrogram").setLevel(WARNING) # turn off pyrogram logging
log = Logger(timezone=Config.TIME_ZONE)
log.set_name("") # Ex: Logger <INFO> some message, `Logger` name will empty

# telegraph /

Expand Down
Loading