If you want a script or bot to have access to your Google Drive account, follow these steps:
Go to the credentials page in the Google Developer Console.
Click on the “create a project” button.
Enter the details below and click create.
Click on the OAuth consent screen, enter your details and click save
Click "Create credentials" -> "OAuth client ID"
Choose "Other" for "Application type". Enter “Scripts” for name and click create.
Take note of the generated client ID and client secret.
Now we need to activate the Drive API. To do that:
Go to Google API Console and click on “Drive api”