Skip to content
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

The bot should ultimately provide one or more links to the repositories for the projects that match the answers. #11 #29

Merged
merged 2 commits into from
May 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,42 @@ def handle_message(payload):
except SlackApiError as e:
print(f"Error sending response: {e.response['error']}")

@app.route('/repo', methods=['POST'])
def list_repo():
data = request.form
command = data.get('command')
text = data.get('text')
user_name = data.get('user_name')
tech_name = text.strip().lower()
response_message = ""

if tech_name == 'django':
response_message = f"Hello {user_name}, You can implement your '{tech_name}' knowledge here:
(https://github.com/OWASP-BLT/BLT)"
Comment on lines +133 to +134
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are multiple SyntaxErrors in the code.

It seems the code hasn't been run/tested properly. I suggest implementing minimal test framework early in order to avoid tech debt stockpiling. Moreover, it's important from the project's future visibility perspective we discussed yesterday.

I'll create a couple of issues in order to shape the scope of work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay sure! Thank you

elif tech_name == 'python':
response_message = f"Hello {user_name}, You can implement your '{tech_name}' knowledge here:
(https://github.com/OWASP-BLT/BLT)
https://github.com/OWASP-BLT/BLT-Flutter)
(https://github.com/OWASP-BLT/BLT-Lettuce)"
elif tech_name == 'flutter' or tech_name == 'dart':
response_message = f"Hello {user_name}, You can implement your '{tech_name}' knowledge here:
(https://github.com/OWASP-BLT/BLT-Flutter)
(https://github.com/OWASP-BLT/BLT-Lettuce)"
elif tech_name == 'blockchain'or tech_name == 'cryptography':
response_message = f"Hello {user_name}, You can implement your '{tech_name}' knowledge here:
(https://github.com/OWASP-BLT/BLT-Bacon)"
elif tech_name == 'javascript':
response_message = f"Hello {user_name}, You can implement your '{tech_name}' knowledge here:
(https://github.com/OWASP-BLT/BLT-Action)
(https://github.com/OWASP-BLT/BLT-Extension)
(https://github.com/OWASP-BLT/BLT)"
elif tech_name == 'html' or tech_name == 'css':
response_message = f"Hello {user_name}, You can implement your '{tech_name}' knowledge here:
(https://github.com/OWASP-BLT/BLT-Extension)
(https://github.com/OWASP-BLT/BLT)"
else:
response_message = f"Hello {user_name}, the technology '{tech_name}' is not recognized. Please try again."
return jsonify({
'response_type': 'in_channel',
'text': response_message,
})