diff --git a/README.md b/README.md index 6bf1401..a4c9e96 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Speak with the official bot, [@SiteAlert_bot][4]! ------------------------ -###License: +### License: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -100,4 +100,4 @@ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [1]: http://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-beautiful-soup [2]: https://github.com/eternnoir/pyTelegramBotAPI/ [3]: https://github.com/ilteoood/SiteAlert-Python/blob/master/SiteAlert_bot.py -[4]: https://telegram.me/SiteAlert_bot \ No newline at end of file +[4]: https://telegram.me/SiteAlert_bot diff --git a/SiteAlert_bot.py b/SiteAlert_bot.py index 9c8a4c1..130e24b 100755 --- a/SiteAlert_bot.py +++ b/SiteAlert_bot.py @@ -10,7 +10,7 @@ site_alert = SiteAlert() leng = "" Array = {} -gen_markup = types.ReplyKeyboardHide(selective=False) +gen_markup = types.ReplyKeyboardRemove(selective=False) wlcm_msg = "!\nWelcome to @SiteAlert_bot.\nCommands available:\n/ping - Pong\n/show - Print the list of saved sites\n/check - Check new website\n/addme - Notify me on an already registered site\n/removeme - Reverse action\n/register - Register your email\n/registered - Check if you are alredy registered, and show your subscribed sites\n/unregister - Delete your registration\n/link - Print the link associated to a website\n/mailoff - Disable mail notification\n/mailon - Reverse action\n/telegramoff - Disable telegram notification\n/telegramon - Reverse action\n/help - Print help message" tb = telebot.TeleBot(TOKEN) @@ -144,13 +144,12 @@ def registered(m): credentials = site_alert.execute_fetch_all("SELECT mail FROM Users WHERE telegram =?", (m.chat.id,)) if len(credentials) > 0: mymsg = "You have registered this e-mail: " + credentials[0] + "\nYour notification status is:\nE-mail: " - status = site_alert.execute_fetch_all("SELECT mailnotification FROM Users WHERE mail = ?", (credentials[0],))[ - 0] + status = site_alert.execute_fetch_all("SELECT mailnotification FROM Users WHERE mail = ?", (credentials[0]))[0] mymsg += status[0] + "\nTelegram: " status = \ - site_alert.execute_fetch_all("SELECT telegramnotification FROM Users WHERE mail = ?", (credentials[0],))[0] + site_alert.execute_fetch_all("SELECT telegramnotification FROM Users WHERE mail = ?", (credentials[0]))[0] mymsg += status[0] + "\nYou are registered to:" - for site in site_alert.execute_fetch_all("SELECT name FROM Registered WHERE mail = ?", (credentials[0],)): + for site in site_alert.execute_fetch_all("SELECT name FROM Registered WHERE mail = ?", (credentials[0])): mymsg = mymsg + "\n" + str(i) + ") " + site[0] i += 1 tb.send_message(m.chat.id, mymsg)