-
Notifications
You must be signed in to change notification settings - Fork 12
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
Make the src(source) command optionally available to users if the owner of the bot decides to #66
Comments
When we talked about this in the server I said that I could just check if the Another method I could go is to link to the repo's source code at the given line if it's not the owner calling the command (again using the |
I think the link idea is a good one as it does prevent flooding and hides the code from people that should not be able to view it, i am not sure how the |
That's an interesting point. The attr is just a link to your repo in the config, but each different platform links to different lines in different ways. I hadn't considered that. I'd also need to guess the branch name. This throws a wrench in the works. |
You do not need to guess the branch name as you could just check what is the active (current) branch using something like GitPython or you could check it manually by running linkways = {'github': 'https://github.com/{username}/{repo}/blob/{commitsha}/{filepath}#L{linenumber}',
'gitlab': 'https://gitlab.com/{username}/{repo}/-/blob/{commitsha}/{filepath}#L{linenumber}'} i am not sure if thats exactly how it should look like but i think it should look similar to it. |
He's right. Personally I would just check the HEAD file if it exists, and default to the default branch of the repo got from the api. |
I'll do some testing and see what works. Thanks for the information. |
Any updates on this? |
Nothing I can show for it. I lost interest, really. If the bot's open source then it's open source. Feel free to PR it but I'm not going to add it. |
This could be for example used in open source bots like apple.py and etc.
If the code is already public why hide the command?
The text was updated successfully, but these errors were encountered: