Skip to content

Commit

Permalink
Merge pull request #9 from SaM-92/dev_b
Browse files Browse the repository at this point in the history
fixed bug with audio and BytesIO
  • Loading branch information
SaM-92 authored Mar 2, 2024
2 parents a38c863 + 07fd1e7 commit b44fe07
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions subs/telegram_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
)
from subs.energy_api import *
from subs.openai_script import *
from io import BytesIO


async def send_co2_intensity_plot(
Expand Down Expand Up @@ -75,13 +76,16 @@ async def telegram_carbon_intensity(update, context, user_first_name):
await send_co2_intensity_plot(update, context, df_with_trend)
# slice the energy saving actions part
energy_saving_actions = get_energy_actions(gpt_recom)
"""
# I stopped voice gen due to cost issues
audio_msg = generate_voice(energy_saving_actions)
await context.bot.send_voice(
update.effective_chat.id,
audio_msg,
caption="Here's your energy-saving tips 🎙️",
)
del audio_msg
"""


async def pie_chart_fuel_mix(update, context, df, net_import_status, current_time):
Expand Down Expand Up @@ -157,6 +161,9 @@ async def telegram_fuel_mix(update, context, user_first_name):
await pie_chart_fuel_mix(
update, context, fuel_mix_eirgrid, net_import_status, now
)
"""
# I stopped voice gen due to cost issues
audio_msg = generate_voice(fuel_mix_response_from_gpt)
await context.bot.send_voice(
Expand All @@ -165,3 +172,4 @@ async def telegram_fuel_mix(update, context, user_first_name):
caption="Here's fuel mix summary 🎙️",
)
del audio_msg
"""

0 comments on commit b44fe07

Please sign in to comment.