Skip to content

Commit dd90ca2

Browse files
authored
Merge branch 'master' into miscs
2 parents b073955 + 64bbbf8 commit dd90ca2

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ An another yet Discord multipurposal bot written in Python.
3131
- Slash commands partial-ready
3232
- Easy installation, setup
3333
- Use the same bot instance on multiple guilds
34-
- Regurarly updates
34+
- Regularly updates
3535

3636
## Installation
3737
### Prerequisites
@@ -152,4 +152,4 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
152152
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
153153
SOFTWARE.
154154

155-
[(Back to top)](#table-of-contents)
155+
[(Back to top)](#table-of-contents)

cogs/utils/github.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import requests
2-
from bs4 import BeautifulSoup
32

43
def get_latest():
54
response = requests.get("https://raw.githubusercontent.com/r-liner/discord-commands-bot/master/version.txt")
@@ -13,9 +12,21 @@ def check_for_updates(version):
1312
return False
1413

1514
def changelog():
16-
latest = get_latest()
17-
response = requests.get(f"https://github.com/r-liner/discord-commands-bot/releases/tag/v{latest}")
18-
soup = BeautifulSoup(response.text, "html.parser")
19-
_changelog = soup.find("div", class_="markdown-body my-3").get_text()
15+
headers = {
16+
"Accept": "application/vnd.github.v3.text+json",
17+
}
18+
19+
response = requests.get(
20+
"https://api.github.com/repos/liner-exe/discord-commands-bot/releases/latest",
21+
headers=headers,
22+
)
23+
24+
if not response.ok:
25+
return ""
26+
27+
data = response.json()
28+
29+
if not data.get("body_text"):
30+
return "" # Raise there error if needed
2031

21-
return _changelog
32+
return data["body_text"]

requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
nextcord==2.6.0
1+
nextcord==2.6.1
22
typing_extensions==4.9.0
3-
psutil==5.9.8
4-
requests==2.31.0
5-
beautifulsoup4==4.12.3
3+
psutil==6.0.0
4+
requests==2.32.2

0 commit comments

Comments
 (0)