-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2b0f98a
Showing
11 changed files
with
899 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Contributing | ||
|
||
Contributions are very welcome! Here are some guidelines on how the project is designed. | ||
|
||
### CodeStyle | ||
|
||
- Adhere to PEP8 as much as possible. | ||
|
||
- Line lengths should be under 120 characters, use list comprehensions over map/filter, don't leave trailing whitespace. | ||
|
||
- More complex pieces of code should be commented for future reference. | ||
|
||
### Structure | ||
|
||
There are a few self-imposed rules on the project structure, to keep the project as tidy as possible. | ||
- All modules should go into the `modules/` directory. | ||
- Any database accesses should be done in `modules/sql/` - no instances of SESSION should be imported anywhere else. | ||
- Make sure your database sessions are properly scoped! Always close them properly. | ||
- When creating a new module, there should be as few changes to other files as possible required to incorporate it. | ||
Removing the module file should result in a bot which is still in perfect working condition. | ||
- If a module is dependent on multiple other files, which might not be loaded, then create a list of at module | ||
load time, in `__main__`, by looking at attributes. This is how migration, /help, /stats, /info, and many other things | ||
are based off of. It allows the bot to work fine with the LOAD and NO_LOAD configurations. | ||
- Keep in mind that some things might clash; eg a regex handler could clash with a command handler - in this case, you | ||
should put them in different dispatcher groups. | ||
|
||
Might seem complicated, but it'll make sense when you get into it. Feel free to ask me for a hand/advice (in `@draj48`)! |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
worker: python3 -m tg_bot | ||
ps:scale worker=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# YUi OFFICIAL | ||
|
||
|
||
Credits - [DEVLOPER]( | ||
|
||
[![Deploy]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
theme: jekyll-theme-architect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"addons": [ | ||
{ | ||
"options": { | ||
"version": "12" | ||
}, | ||
"plan": "heroku-postgresql" | ||
} | ||
], | ||
"description": "Telegram group management bot.", | ||
"env": { | ||
"ALLOW_EXCL": { | ||
"description": "Set this to True if you want ! to be a command prefix along with /", | ||
"value": "True" | ||
}, | ||
"BAN_STICKER": { | ||
"description": "ID of the sticker you want to use when banning people.", | ||
"required": false, | ||
"value": "" | ||
}, | ||
"DEL_CMDS": { | ||
"description": "Set this to True if you want to delete command messages from users who don't have the perms to run that command.", | ||
"value": "True" | ||
}, | ||
"ENV": { | ||
"description": "Setting this to ANYTHING will enable environment variables.", | ||
"value": "ANYTHING" | ||
}, | ||
"SQLALCHEMY_DATABASE_URI": { | ||
"description": "Your postgres sql db, empty this field if you dont have one.", | ||
"required": false, | ||
"value": "sqldbtype://username:pw@hostname:port/db_name" | ||
}, | ||
"OWNER_ID": { | ||
"description": "Your user ID as an integer.", | ||
"value": "710828300" | ||
}, | ||
"OWNER_NAME": { | ||
"description": "Your username", | ||
"value": "Developer_boy_sd_owner" | ||
}, | ||
"DEV_USERS": { | ||
"description": "ID of users who are Dev (can use /py etc.)", | ||
"required": false, | ||
"value": "710828300" | ||
}, | ||
"GRAND_IMG": { | ||
"description": "Image shows when hit /start", | ||
"value": "https://firebasestorage.googleapis.com/v0/b/wallpaper-4c232.appspot.com/o/download%20(7).jpeg?alt=media&token=e6c38225-0b64-42f7-916c-a5149cd14131" | ||
}, | ||
"GBAN_LOGS": { | ||
"description": "Gban log channel, include the hyphen too: ex: -123456", | ||
"value": "-123" | ||
}, | ||
"CASH_API_KEY": { | ||
"description": "Required for currency converter", | ||
"value": "-xyz" | ||
}, | ||
"TIME_API_KEY": { | ||
"description": "Required for timezone information", | ||
"value": "HW6LQCYX43HS" | ||
}, | ||
"AI_API_KEY": { | ||
"description": "for activate chatbot", | ||
"value": "x_y_z" | ||
}, | ||
"API_OPENWEATHER": { | ||
"description": "Required for weather information", | ||
"value": "5c5adc2bc1832de6943e3f4467e84c39" | ||
}, | ||
"PORT": { | ||
"description": "Port to use for your webhooks.", | ||
"required": false, | ||
"value": "" | ||
}, | ||
"STRICT_GBAN": { | ||
"description": "Enforce gbans across new groups as well as old groups. When a gbanned user talks, he will be banned.", | ||
"value": "True" | ||
}, | ||
"SUDO_USERS": { | ||
"description": "A space separated list of user IDs who you want to assign as sudo users.", | ||
"required": false, | ||
"value": "710828300" | ||
}, | ||
"TIGER_USERS": { | ||
"description": "A space separated list of user IDs who you wanna assign as tiger users.", | ||
"required": false, | ||
"value": "710828300" | ||
}, | ||
"TOKEN": { | ||
"description": "Your bot token.", | ||
"required": true, | ||
"value": "" | ||
}, | ||
"URL": { | ||
"description": "The Heroku App URL :- https://<appname>.herokuapp.com/", | ||
"required": false, | ||
"value": "" | ||
}, | ||
"WEBHOOK": { | ||
"description": "Setting this to ANYTHING will enable webhooks.", | ||
"required": false, | ||
"value": "" | ||
}, | ||
"WHITELIST_USERS": { | ||
"description": "A space separated list of user IDs who you want to assign as whitelisted - can't be banned with your bot.", | ||
"required": false, | ||
"value": "710828300" | ||
} | ||
}, | ||
"keywords": [ | ||
"telegram", | ||
"group", | ||
"manager", | ||
"bot" | ||
], | ||
"logo": "https://firebasestorage.googleapis.com/v0/b/wallpaper-4c232.appspot.com/o/download%20(7).jpeg?alt=media&token=e6c38225-0b64-42f7-916c-a5149cd14131", | ||
"name": "Fire_Bot", | ||
"repository": "https://github.com/developer-boy-sdowner" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
future | ||
emoji | ||
beautifulsoup4 | ||
requests | ||
sqlalchemy | ||
python-telegram-bot==11.1.0 | ||
psycopg2-binary | ||
feedparser | ||
pynewtonmath | ||
spongemock | ||
zalgo-text | ||
geopy | ||
nltk | ||
psutil | ||
aiohttp>=2.2.5 | ||
Pillow>=4.2.0 | ||
CurrencyConverter | ||
googletrans | ||
jikanpy | ||
speedtest-cli | ||
coffeehouse | ||
tswift | ||
gTTS | ||
wikipedia | ||
pyowm | ||
tabulate | ||
parsel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
start cmd.exe /c start_service.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python-3.8.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@echo off | ||
TITLE phantom Robot | ||
rem This next line removes any fban csv files if they exist in root when bot restarts. | ||
del *.csv | ||
py -3.7 --version | ||
IF "%ERRORLEVEL%" == "0" ( | ||
py -3.7 -m tg_bot | ||
) ELSE ( | ||
py -m tg_bot | ||
) | ||
|
||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@echo off | ||
|
||
:: BatchGotAdmin | ||
:------------------------------------- | ||
REM --> Check for permissions | ||
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" | ||
|
||
REM --> If error flag set, we do not have admin. | ||
if '%errorlevel%' NEQ '0' ( | ||
echo Requesting administrative privileges... | ||
goto UACPrompt | ||
) else ( goto gotAdmin ) | ||
|
||
:UACPrompt | ||
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" | ||
set params = %*:"="" | ||
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" | ||
|
||
"%temp%\getadmin.vbs" | ||
del "%temp%\getadmin.vbs" | ||
exit /B | ||
|
||
:gotAdmin | ||
pushd "%CD%" | ||
CD /D "%~dp0" | ||
:-------------------------------------- | ||
net stop phantomRobot | ||
net start phantomRobot |