Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
john-flagship committed Sep 24, 2023
1 parent bc715d7 commit 5a9d18a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 94 deletions.
49 changes: 2 additions & 47 deletions localsrc/localapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def process_event(body, context):
)
return

# if (command_text==WAIT_MESSAGE) or (command_text.startswith("/")) or (command_text.startswith("|SnC|")):
if (command_text==WAIT_MESSAGE) or (command_text.startswith("/")):
# No processing needed if the message was generated by this bot or is a Slack slash command
return
Expand All @@ -146,49 +145,6 @@ def process_event(body, context):
)
return

# if command_text.startswith(":pix "):
# image_text = command_text.replace(":pix ", "").strip()
# if image_text:
# app.client.chat_postMessage(
# channel=channel_id,
# thread_ts=thread_ts,
# text=f"Generating your image...just a sec"
# )
# try:
# response = generate_image(image_text)
# except Exception as e:
# logger.error(response)
# app.client.chat_postMessage(
# channel=channel_id,
# thread_ts=thread_ts,
# text=f"Error generating image: {e}"
# )
# return
# app.client.chat_postMessage(
# channel=channel_id,
# thread_ts=thread_ts,
# text=".", # Used to suppress Slack warnings about not including text in the post
# blocks=[
# {
# "type": "image",
# "title": {
# "type": "plain_text",
# "text": image_text,
# "emoji": True
# },
# "image_url": response['blocks'][0]['image_url'],
# "alt_text": image_text
# }
# ]
# )
# else:
# app.client.chat_postMessage(
# channel=channel_id,
# thread_ts=thread_ts,
# text="No text provided for image generation."
# )
# return

slack_resp = app.client.chat_postMessage(
channel=channel_id,
thread_ts=thread_ts,
Expand Down Expand Up @@ -262,9 +218,8 @@ def process_event(body, context):
thread_ts=thread_ts,
text=f"I can't provide a response. Encountered an error:\n`\n{e}\n`"
)
logger.debug("DEBUG: end command_handler")


logger.debug("DEBUG: end command_handler")

def chunk_n_update(openai_response, app, channel_id, reply_message_ts):
response_text = ""
ii = 0
Expand Down
49 changes: 2 additions & 47 deletions src/wkid_smaaht.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def process_event(body, context):
)
return

# if (command_text==WAIT_MESSAGE) or (command_text.startswith("/")) or (command_text.startswith("|SnC|")):
if (command_text==WAIT_MESSAGE) or (command_text.startswith("/")):
# No processing needed if the message was generated by this bot or is a Slack slash command
return
Expand All @@ -146,49 +145,6 @@ def process_event(body, context):
)
return

# if command_text.startswith(":pix "):
# image_text = command_text.replace(":pix ", "").strip()
# if image_text:
# app.client.chat_postMessage(
# channel=channel_id,
# thread_ts=thread_ts,
# text=f"Generating your image...just a sec"
# )
# try:
# response = generate_image(image_text)
# except Exception as e:
# logger.error(response)
# app.client.chat_postMessage(
# channel=channel_id,
# thread_ts=thread_ts,
# text=f"Error generating image: {e}"
# )
# return
# app.client.chat_postMessage(
# channel=channel_id,
# thread_ts=thread_ts,
# text=".", # Used to suppress Slack warnings about not including text in the post
# blocks=[
# {
# "type": "image",
# "title": {
# "type": "plain_text",
# "text": image_text,
# "emoji": True
# },
# "image_url": response['blocks'][0]['image_url'],
# "alt_text": image_text
# }
# ]
# )
# else:
# app.client.chat_postMessage(
# channel=channel_id,
# thread_ts=thread_ts,
# text="No text provided for image generation."
# )
# return

slack_resp = app.client.chat_postMessage(
channel=channel_id,
thread_ts=thread_ts,
Expand Down Expand Up @@ -262,9 +218,8 @@ def process_event(body, context):
thread_ts=thread_ts,
text=f"I can't provide a response. Encountered an error:\n`\n{e}\n`"
)
logger.debug("DEBUG: end command_handler")


logger.debug("DEBUG: end command_handler")

def chunk_n_update(openai_response, app, channel_id, reply_message_ts):
response_text = ""
ii = 0
Expand Down

0 comments on commit 5a9d18a

Please sign in to comment.