1
0
Fork 0

Forgot some bugs with the push error

This commit is contained in:
Ethanell 2019-09-18 17:37:52 +02:00
parent fde9cdaf4e
commit 3c0ebc25d9
3 changed files with 9 additions and 9 deletions

View file

@ -57,8 +57,8 @@ class Event(ics.Event):
def __str__(self): def __str__(self):
return markdown.text( return markdown.text(
markdown.bold(f"<{str(self.begin.date())[5:]}>"), markdown.bold(f"<{str(self.begin.date())[5:]}>"),
markdown.code(f"\uD83D\uDCD3[{self.name}]:"), markdown.code(f"📓[{self.name}]:"),
markdown.text(f"\u231A{str(self.begin.time())[:-3]} -> {str(self.end.time())[:-3]}"), markdown.text(f"{str(self.begin.time())[:-3]} -> {str(self.end.time())[:-3]}"),
markdown.italic(f"\uD83D\uDCCD{self.location} \uD83D\uDC68\u200D\uD83C\uDFEB{self.organizer}"), markdown.italic(f"📍{self.location} 👨‍🏫{self.organizer}"),
sep="\n" sep="\n"
) # surrogates not allowed )

View file

@ -1,6 +1,6 @@
{ {
"welcome": "\uD83D\uDCA0 *Welcome to the TelegramEDT bot !* \uD83D\uDCA0\n\uD83D\uDD39Please use the command /setedt to set your calendar\n\uD83D\uDD39Use /notif to configure events notification\n\u2139And /help for more commands", "welcome": "\uD83D\uDCA0 *Welcome to the TelegramEDT bot !* \uD83D\uDCA0\n\uD83D\uDD39Please use the command /setedt to set your calendar\n\uD83D\uDD39Use /notif to configure events notification\n\u2139And /help for more commands",
"help": "\u2139 *Commands help* \u2139\n\uD83D\uDCC5/edt, show your next events\n\uD83D\uDD14/notif, set your events notifications\n\u2699/setedt, set your calendar", "help": "\u2139 *Commands help* \u2139\n\uD83D\uDCC5/edt, show your next events\n\uD83D\uDD14/notif, set your events notifications\n\u2699/setedt, set your calendar\n\uD83D\uDCE4\t/getedt to show your ressource",
"edt_err_set": "Your EDT is not set ! \u274C\n\u2139Use /setedt to fix that", "edt_err_set": "Your EDT is not set ! \u274C\n\u2139Use /setedt to fix that",
"edt_err_choice": "Invalid choice ! \u274C\n\u2139You can choose between: `day`, `next`, `week`, `next week`", "edt_err_choice": "Invalid choice ! \u274C\n\u2139You can choose between: `day`, `next`, `week`, `next week`",
"setedt_err_res": "Invalid resources ! \u274C", "setedt_err_res": "Invalid resources ! \u274C",

8
bot.py
View file

@ -167,7 +167,7 @@ async def notif_cmd(message: types.Message):
logger.info(f"{message.from_user.username} do notif command: {message.text}") logger.info(f"{message.from_user.username} do notif command: {message.text}")
with dbL: with dbL:
with shelve.open("edt", writeback=True) as db: with shelve.open("edt", writeback=True) as db:
if message.text[7:10] == "toggle": if message.text[7:13] == "toggle":
if db[user_id].nt: if db[user_id].nt:
res = False res = False
else: else:
@ -184,11 +184,11 @@ async def notif_cmd(message: types.Message):
msg = lang(db[user_id], "notif_err_num") msg = lang(db[user_id], "notif_err_num")
else: else:
if cut == 11: if cut == 11:
db[user_id]["notif"].nt_time = int(message.text[cut+1:]) db[user_id].nt_time = int(message.text[cut+1:])
else: else:
db[user_id]["notif"].nt_cooldown = int(message.text[cut + 1:]) db[user_id].nt_cooldown = int(message.text[cut + 1:])
msg = lang(db(user_id), "notif_time_cooldown").format(message.text[7:cut], message.text[cut + 1:]) msg = lang(db[user_id], "notif_time_cooldown").format(message.text[7:cut], message.text[cut + 1:])
elif message.text[7:11] == "info": elif message.text[7:11] == "info":
msg = lang(db[user_id], "notif_info").format(db[user_id].nt, db[user_id].nt_time, msg = lang(db[user_id], "notif_info").format(db[user_id].nt, db[user_id].nt_time,