fix: parse verify credentials user id
This commit is contained in:
@@ -205,11 +205,15 @@ export function withUsers<TBase extends AbstractConstructor<TwitterClientBase>>(
|
||||
? data.user_id
|
||||
: typeof data?.user_id_str === 'string'
|
||||
? data.user_id_str
|
||||
: typeof data?.user?.id_str === 'string'
|
||||
? data.user.id_str
|
||||
: typeof data?.user?.id === 'string'
|
||||
? data.user.id
|
||||
: null;
|
||||
: typeof data?.id_str === 'string'
|
||||
? data.id_str
|
||||
: typeof data?.id === 'string'
|
||||
? data.id
|
||||
: typeof data?.user?.id_str === 'string'
|
||||
? data.user.id_str
|
||||
: typeof data?.user?.id === 'string'
|
||||
? data.user.id
|
||||
: null;
|
||||
|
||||
if (username && userId) {
|
||||
this.clientUserId = userId;
|
||||
|
||||
Reference in New Issue
Block a user