aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Andi Qu <[email protected]>2021-01-30 22:53:52 +0200
committerGravatar Andi Qu <[email protected]>2021-01-30 22:53:52 +0200
commit25702f7d44eefbdb3d727b39bc0752e042320d8d (patch)
tree96cf999fc0b98fd67ac79cee484dfdf6fc2a6b07
parentGot rid of unnecessary regex matching things (diff)
Use the GitLab API for GitLab snippets
-rw-r--r--bot/exts/info/code_snippets.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bot/exts/info/code_snippets.py b/bot/exts/info/code_snippets.py
index 4c8de05fc..e149b5637 100644
--- a/bot/exts/info/code_snippets.py
+++ b/bot/exts/info/code_snippets.py
@@ -127,8 +127,11 @@ class CodeSnippets(Cog):
enc_repo = quote_plus(repo)
# Searches the GitLab API for the specified branch
- branches = await self._fetch_response(f'https://api.github.com/repos/{repo}/branches', 'json')
- tags = await self._fetch_response(f'https://api.github.com/repos/{repo}/tags', 'json')
+ branches = await self._fetch_response(
+ f'https://gitlab.com/api/v4/projects/{enc_repo}/repository/branches',
+ 'json'
+ )
+ tags = await self._fetch_response(f'https://gitlab.com/api/v4/projects/{enc_repo}/repository/tags', 'json')
refs = branches + tags
ref, file_path = self._find_ref(path, refs)
enc_ref = quote_plus(ref)