brantian

brantian

Member Since 1 year ago

Experience Points
0
follower
Lessons Completed
0
follow
Lessons Completed
1
stars
Best Reply Awards
0
repos

57 contributions in the last year

Pinned
Activity
Nov
3
1 month ago
Activity icon
issue

brantian issue comment facebook/facebook-nodejs-business-sdk

brantian
brantian

No way to override access_token

Because the access_token is set when you first init the api e.g. const api = adsSdk.FacebookAdsApi.init(accessToken); it means that you are unable to switch it if required.

For example, I'm currently using a marketing access_token to get my parent business and to then get all facebook pages associated with that parent business manager. I can do this by running the method... parentBusinessManager.getClientPages();

I would then like to get all the instagram accounts associated with each of those Facebook pages. But if I try to do the following: page.getInstagramAccounts(['username']) It will throw an error saying that I need to use a "Page access token".

This is frustrating because the other access_token works for everything else. I actually get the page access_token back when I request the client pages, but there's no way to use it with the SDK at that point.

For example, I was hoping I could just override the access_tokenby passing it into the params like so:

this.page.getInstagramAccounts(
      ['username'],
      { access_token: accessToken },
    );

But, if you look at the code below in api.js, the access_token is overwritten on the params before the params object is used. https://github.com/facebook/facebook-nodejs-business-sdk/blob/4d52015eb512d9900bda7a93933e1b121b48915f/src/api.js#L77

It would be nice if the call() function checked whether you've passed a new access_token in the params argument, and if so, used it. Otherwise, it could fallback to using this.access_token. This seems like it would be a simple, yet powerful change that would allow a lot more flexibility with the SDK.

brantian
brantian

Any updates on this? I'm having a similar problem. I'm working with multiple access tokens from multiple users and I am having problem with concurrent operations

Oct
10
1 month ago
Activity icon
issue

brantian issue comment remix-run/react-router

brantian
brantian

[v6] [Bug]: Nested Routes with useRoutes losing router state

What version of React Router are you using?

6.0.0-beta.6

Steps to Reproduce

Expected Behavior

I would expect the useLocation() call to return the browser state on the state parameter. I'm mostly interested in being able to check the referrer, or previous path, when a page is loaded.

Actual Behavior

The useLocation() call returns null on state param

brantian
brantian

Hi @timdorr , thanks for your response. Would you please indicate to me where I can find more information on how to set this state on the location? I cant find anything that works with the useRoutes hook

Oct
9
1 month ago
Activity icon
issue

brantian issue remix-run/react-router

brantian
brantian

[Bug] v6 Nested Routes with useRoutes losing router state

What version of React Router are you using?

6.0.0-beta.6

Steps to Reproduce

Expected Behavior

I would expect the useLocation() call to return the browser state on the state parameter. I'm mostly interested in being able to check the referrer, or previous path, when a page is loaded.

Actual Behavior

The useLocation() call returns null on state param

Sep
28
2 months ago
Activity icon
issue

brantian issue comment alik0211/mtproto-core

brantian
brantian

Need help with channels.getParticipants

Hello! Is there a way to get more than 200 participants from a telegram channel?

I'm using the following code:

async function getAndSaveParticipants(data) {
	const inputChannel = {
		_: 'inputChannel',
		channel_id: data.id,
		access_hash: data.access_hash
	};

	let offset = 0;
	while (true) {
		const getParticipants = await mtproto.call('channels.getParticipants', {
			channel: inputChannel,
			filter: {
				_: 'channelParticipantsSearch'
			},
			offset: offset,
			limit: 100
		});

		if (getParticipants.users.length > 0) {
			await saveUsersToFile(getParticipants);
			offset = offset + getParticipants.users.length;
		} else {
			break;
		}
	}
}

This i'm recieving after the last chunk of users:

{
  _: 'channels.channelParticipants',
  count: 200,
  participants: [],
  users: []
}
brantian
brantian

@caioagiani no, unfortunately. I dont think there's a solution for that because it's a limitation on the Telegram product. Even on the mobile app, you can't see more than 200 participants for a channel even if you own it