repo.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. from wbb import app
  2. from wbb.utils import cust_filter
  3. import requests
  4. __MODULE__ = "Repo"
  5. __HELP__ = "/repo - To Get My Github Repository Link"
  6. api = 'https://api.github.com/repos/thehamkercat/' \
  7. 'WilliamButcherBot/stats/contributors'
  8. print(api)
  9. @app.on_message(cust_filter.command(commands=("repo")))
  10. async def repo(client, message):
  11. app.set_parse_mode("markdown")
  12. profile_url = []
  13. username = []
  14. # Get The List Of Usernames And Profile Url
  15. for item in requests.get(api).json():
  16. profile_url.append(f"{item['author']['html_url']}")
  17. username.append(f"{item['author']['login']}")
  18. # Join Usernames And Profile Url For Markdown
  19. no_of_contributors = len(username)
  20. i = 0
  21. n = 1
  22. contributors = ""
  23. while i < no_of_contributors:
  24. contributors += f"[{n}. {username[i]}]({profile_url[i]})\n"
  25. n += 1
  26. i += 1
  27. await message.reply_text(f'''
  28. ```Devs and Contributors```
  29. {contributors}
  30. ```Source Code```[Github](https://github.com/thehamkercat/WilliamButcherBot)
  31. ''', disable_web_page_preview=True)