R
R
Righty2021-03-06 08:20:19
Python
Righty, 2021-03-06 08:20:19

Where to find the Dialogflow token?

I wanted to make my bots the function of communicating with the user thanks to the neural network, I decided to use Dialogflow. And I wrote this code:

import discord
from discord.ext import commands
from config import settings
import apiai, json

bot = commands.Bot(command_prefix = settings['prefix'])
@bot.command() 
async def talk(ctx):
    content = ctx.message.content.split()
    request = apiai.ApiAI('Dialogflow_Token').text_request()
    request.lang = 'en'
    request.query = content
    responseJson = json.loads(request.getresponse().read().decode('utf-8'))
    response = responseJson
    await ctx.send(response)
    
bot.run(settings['token'])

But I can't figure out where to get the Dialogflow token. I searched on the Internet and still did not understand. Explain, please)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2021-03-06
@Righty

Dialogflow v2 no longer uses developer/client access tokens. This was only for v1.
To access API endpoints, you need to set up authentication and upload private keys.
If you are using a library, you should simply be able to make the downloaded keys available to your library. If you are doing it yourself, you will need to generate an OAuth 2 authentication token using these keys.

source: https://stackoverflow.com/questions/63357545/could...

I
idShura, 2021-03-06
@idShura

Here 's the first instruction you came across.

S
Shinso, 2017-12-16
@YanaLins

The height of the pictures affects them, you can set the height of the blocks in which they are located a little more than the largest picture to make it disappear. For example:

.image-effect {
    height: 240px;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question