forked from X-Gorn/MangaLoader
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added cleandir option & some changes
- Loading branch information
Showing
4 changed files
with
38 additions
and
37 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
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 |
---|---|---|
@@ -1,32 +1,26 @@ | ||
import os, shutil | ||
from pyrogram import Client, filters | ||
from pyrogram.types.bots_and_keyboards import InlineKeyboardButton, InlineKeyboardMarkup | ||
from pyrogram.types.bots_and_keyboards import InlineKeyboardMarkup | ||
from translation import Translation | ||
|
||
|
||
@Client.on_message(filters.private & filters.command('start')) | ||
def _start(bot, update): | ||
bot.send_message( | ||
chat_id=update.chat.id, | ||
text=Translation.START_TEXT.format(str(update.from_user.first_name)), | ||
reply_markup=InlineKeyboardMarkup( | ||
[ | ||
[ | ||
InlineKeyboardButton( | ||
"Source", url="https://github.com/X-Gorn/MangaLoader" | ||
), | ||
InlineKeyboardButton("Project Channel", url="https://t.me/xTeamBots"), | ||
], | ||
[InlineKeyboardButton("Author", url="https://t.me/xgorn")], | ||
] | ||
), | ||
reply_to_message_id=update.message_id | ||
update.reply_text( | ||
Translation.START_TEXT.format(str(update.from_user.first_name)), reply_markup=InlineKeyboardMarkup(Translation.start_buttons) | ||
) | ||
|
||
|
||
@Client.on_message(filters.private & filters.command('help')) | ||
def _help(bot, update): | ||
bot.send_message( | ||
chat_id=update.chat.id, | ||
text=Translation.HELP_TEXT, | ||
reply_to_message_id=update.message_id | ||
) | ||
update.reply_text(Translation.HELP_TEXT) | ||
|
||
|
||
@Client.on_message(filters.private & filters.command('cleandir')) | ||
def _cleandir(bot, update): | ||
dirx = './Manga/' | ||
if os.path.isdir(dirx): | ||
shutil.rmtree(dirx) | ||
update.reply_text(Translation.CLEANDIR_SUCCESS) | ||
else: | ||
update.reply_text(Translation.CLEANDIR_UNSUCCESS) |
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
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