commit
7540dbeae4
@ -0,0 +1,10 @@
|
||||
import re
|
||||
from utils import print_substep
|
||||
|
||||
def id(reddit_obj: dict):
|
||||
"""
|
||||
This function takes a reddit object and returns the post id
|
||||
"""
|
||||
id = re.sub(r"[^\w\s-]", "", reddit_obj["thread_id"])
|
||||
print_substep(f"Thread ID is {id}", style="bold blue")
|
||||
return id
|
@ -0,0 +1,16 @@
|
||||
import requests
|
||||
from utils.console import print_step
|
||||
|
||||
|
||||
def checkversion(__VERSION__):
|
||||
response = requests.get(
|
||||
"https://api.github.com/repos/elebumm/RedditVideoMakerBot/releases/latest"
|
||||
)
|
||||
latestversion = response.json()["tag_name"]
|
||||
if __VERSION__ == latestversion:
|
||||
print_step(f"You are using the newest version ({__VERSION__}) of the bot")
|
||||
return True
|
||||
else:
|
||||
print_step(
|
||||
f"You are using an older version ({__VERSION__}) of the bot. Download the newest version ({latestversion}) from https://github.com/elebumm/RedditVideoMakerBot/releases/latest"
|
||||
)
|
Loading…
Reference in new issue