Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is DM still working? #65

Open
mycroftcanner opened this issue Jan 15, 2024 · 1 comment
Open

Is DM still working? #65

mycroftcanner opened this issue Jan 15, 2024 · 1 comment

Comments

@mycroftcanner
Copy link

func main() {
	username := os.Getenv("IG_USERNAME")
	username = strings.TrimSpace(username)

	password := os.Getenv("IG_PASSWORD")
	password = strings.TrimSpace(password)

	insta, err := goinsta.Import("goinsta-" + username)
	if err != nil {
		if username == "" || password == "" {
			fmt.Println("Please set IG_USERNAME and IG_PASSWORD environment variables.")
			os.Exit(1)
		}

		insta = goinsta.New(username, password)
		fmt.Println("Logging in...")
		if err = insta.Login(); err != nil {
			panic(err)
		}

		fmt.Println("Logged in as", insta.Account.Username)
		// insta.OpenApp()

		if err = insta.Export("goinsta-" + insta.Account.Username); err != nil {
			panic(err)
		}
	}
	if err = insta.Inbox.Sync(); err != nil {
		panic(err)
	}

	if err = insta.Inbox.SyncPending(); err != nil {
		panic(err)
	}

	if err = insta.Export("goinsta-" + insta.Account.Username); err != nil {
		panic(err)
	}

	fmt.Printf("You have %d pending requests\n", len(insta.Inbox.Pending))
	fmt.Printf("You have %d conversations\n", len(insta.Inbox.Conversations))
	fmt.Printf("You have %d unseen conversations\n", insta.Inbox.UnseenCount)

You have 0 pending requests
You have 0 conversations
You have 0 unseen conversations

Am I doing something wrong?

@Valdenirmezadri
Copy link

I also want to know, I need to send and receive messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants