Skip to content

Commit

Permalink
Add title
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanLua authored Jul 4, 2024
1 parent 318efe4 commit f96322a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/instagram_to_discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@

L = instaloader.Instaloader()

def send_to_discord(post_url, image_url, author_name, author_icon_url, post_description, post_timestamp):
def send_to_discord(post_url, image_url, author_name, author_icon_url, post_description, post_timestamp, author_fullname):
"""Send a new Instagram post to Discord using a webhook."""
data = {
"content": f"{post_url}",
"embeds": [
{
"title": author_fullname,
"description": post_description,
"url": post_url,
"color": 13500529,
"timestamp": post_timestamp.strftime("%Y-%m-%dT%H:%M:%S"),
"author": {
Expand Down Expand Up @@ -59,14 +61,16 @@ def check_for_new_posts():
author_icon_url = profile.profile_pic_url
post_description = post.caption
post_timestamp = post.date
author_fullname = profile.full_name

send_to_discord(
instagram_post_url,
image_url,
author_name,
author_icon_url,
post_description,
post_timestamp
post_timestamp,
author_fullname
)
break

Expand Down

0 comments on commit f96322a

Please sign in to comment.