-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement /past #36
Comments
I like the idea of displaying all previous events. We should probably choose a different format than the one in Some pseudo code how I think this could work: # __init__.py
@bot.message_handler(commands=['past'])
def past(message):
events = Event.all_events()
if not events:
# Send 404 template
for event in events:
# send event via send_tempalte # db_objects.py
class Event:
# ...
@classmethod
def all_events():
with sqlite3.connect(DB_NAME) as conn:
curs = conn.cursor()
# Get all events from DB.
curs.execute("""select * from Events""")
result = curs.fetchall()
if not result:
return None
events = []
# Unpack DB result into list of Events
return events |
Totally! I just think that this feature needs to go live asap to give @wuestbot a meaning. Therefore a first solution that simply replies all event-db-entries is still a valuable solution imo that is easier to implement. I'd like to tackle this first, also to get some code insights that are easier do digest for a newbie like me. ;) Let me know if you have any concerns. |
Absolutely. The logic behind both solutions will be the same as the display of events will be controlled by the template. You can just go ahead with a "naive" template implementation that displays all events and then have a 2nd PR that adjusts the template. |
We agreed on the following layout for the first PR:
In the 2nd PR we want to include links to events and artists. |
/past shows event information of past events.
The text was updated successfully, but these errors were encountered: