Telegram File to Link bot not streaming anything in http or https - bots

Hey I'm trying to make a Telegram File to Link bot from GitHub repo. I edited many old files. Everything works fine. Bot even gives link for files. But that link does not stream/download anything.
In heroku it was no problem. But now I'm using railway .
Link which is given by bot
Link :- https://0.0.0.0/1249/Pretty+Baby+%281978%29%5BDVDRip%5D%5Bbig_dad_e%5D.avi
Please can anyone solve this?
I tried to change to repo to work in web application.
I want this bot give me links which streams / downloads any telegram file over http/https.

Related

Google's dialogflow integration "dialogflow messenger" (beta)

I am trying to use dialogflow's integration called "Dialogflow messenger" (This isn't the interface to microsoft messenger). The integration is at beta stage, but I would have expected it to work at this bsaic level. When I configure it, if I click "try it here" ini the dialogflow console all is well.
I copied and pasted the dialogflow messenger integration into an html page on my laptop but when I open the page I get a CORS error.
Here is what I pasted - copied from the integration item
I copied and pasted the dialogflow messenger integration into an html page on my laptop but when I open the page I get a CORS error.
Here is what I pasted - copied from the integration item
<script src="https://www.gstatic.com/dialogflow-console/fast/messenger/bootstrap.js?v=1"></script>
<df-messenger
chat-icon="417a4c06-c7a0-4fb4-8b42-8d4ba853f941_x.png"
intent="WELCOME"
chat-title="SupaMoov"
agent-id="xxx"
language-code="en"
></df-messenger>
here is the error:
SupaChat%20-%20google-1.html:1 Access to XMLHttpRequest at 'https://dialogflow.cloud.google.com/v1/integrations/messenger/webhook/xxx/sessions/dfMessenger-20080482' from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
How do I resolve this?
The problem is that you can't insert the html and open it directly from your file system. You need to open from a web server that could be with NodeJs, Java, php or whatever you want. Then put this script at the end of the body.
If it can be useful for you, I am intesively expimenting with this and I have prepared three videos in Youtube that can help to
Create the chatbot for dialoflow messenger,
Launch a web server with NodeJs and personalize the imagen of the chatbot
How to capture the javascript event in your web that generate the interactions with the chatbot.
I have prepare a Youtube list with those videos (in spanish but code can be understood easily) https://www.youtube.com/playlist?list=PLnNbmcjjevxs_Uj-hAeekSbb4Yb7FZERe
I hope that this could help.
I got in touch with Google support. Their answer is:
"to work you have to run it within a web server, you can try xampp"
Not great! I was looking to convert from IBM watson to dialogflow, but the watson integration is much more sophisticated, so I'll be staying with IBM.
I also had this problem.
I decided to publish it on an S3 (Static Site) on Amazon.
Just put the html and another files in Bucket.
Complete information here:
https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
You can paste the embedding code into an embed code block in a Google Site and then you will not need a web server.
Here is the embed button Once you click embed, then click Embed code and paste in the code from Dialogflow.
You can also work on it on your local host using a simple Flask script.
from flask import Flask, request, send_from_directory,render_template
app = Flask(__name__, static_url_path='/static',template_folder='./')
#app.route("/")
def shadow():
return render_template("shadow.html")#assuming this is the name of your html file
if __name__ == "__main__":
app.run(host='localhost' , port=5000 , debug=True)
Then just open it at http://localhost:5000/ in your browser.
There is a dependency as this is assuming you have installed Python3 and Flask in your system.
To install Flask using Python 3.x
pip install flask
Or if you have Python2 by default, you would need to do
pip3 install Flask
This is of course, if you are working locally that is.
CORS is a mechanism that restricts requests coming from a different origin (domain). This is usually common when testing locally so when you deploy, the error will go away.
Usually, A request coming from a different origin is known as a cross-origin request. Cross-origin requests are vital for when your site needs to load data from other services. Essentially, CORS allows servers to specify who can access their resources and how.
-- The easiest and most reliable way to CORS in Safari is to disable CORS in the develop menu.
Enable the develop menu by going to Preferences > Advanced.
Then select “Disable Cross-Origin Restrictions” from the develop menu.
MAKE SURE YOU SWITCH IT BACK WHEN YOU FINISH TESTING.
-- I believe Firefox has a plugin you can install as well.
-- There are other more technical ways of fixing this via middleware, but this is a simple workaround.
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
The way I solve having a webchat with Dialogflow is by using the WebChat by Voximplant Kit.
Is very simple to use and allows you to connect your DF ES or CX Agent through a JS function.
You can test the platform and then having human agents connected than can answer the questions that the DF Agent can't. Don't forget about that.
Web Chat creation with Voximplant Kit in action demo video
Web Chat Documentation
JS Script to create a Function to Connect the Dialogflow Agent with a Queue created in Voximplant Kit.
I hope this simplifies your life! You can reach me out in Discord.
You can just create an html index just like overhere on my github page. Here is 5 minute guide to github pages, Will take less than 15 minutes for the whole process.

Deploying azure bot on website with directline 3.0 on NODEjs

I am trying to host my web app on localhost. I am using directline 3.0 and I want to push the messages into a window using websockets. I don't want to embed the bot. I already have the GET and POST request so I can send and receive the conversation by running the javascript files with the bearer tokens and get back the conversation running by sending and receiving messages from the bot but I want this to take place on the localhost website on a chat based window without embedding.
How can I do this? How do I link the chat window of websockets to the GET and post files so i can send the messages in real time.
I would recommend you integrate Direct Line directly (no pun intended) into you project by using the BotFramework-DirectLineJS package. This package is built specifically for communicating with a bot without using WebChat as the UI component.
There is a v3 example that you can reference. The project splits between the DirectLineBot and the DirectLineClient. The DirectLineBot demonstrates a v3 bot. You'll need to update this folder to include your v4 bot. The DirectLineClient works the same with v3 or v4. So, as your client connects, generates a token, and begins sending activities, your v4 bot should pick these up and respond accordingly. Similarly, your client should pick up the bot's responses.
At this point, you need to update your client to display the activities as they are sent and received from the user / bot.
You might also consider looking over this unofficial "plain ui" sample from the WebChat dev. It uses React however it does not rely on WebChat as the UI component. I was able to spin it up in about 5 mins. It is purposefully stripped of any styling and simply posts activities to the page as text/json objects.
You could remove the input field and configure the page to accept inputs to render on the page. It might be a useful starting place and could fit well with the above DirectLineJS option.
If none of those options are agreeable, then you will need to use Axios, Fetch, or some similar package to make your GET, POST, etc., calls between your client and bot.
Hope of help!

Sending and Receiving data from a website to NodeJs application

basically I am trying to figure out a way to make a connection between my Discord Bot and my Website, I have some ideas in mind in using GET and POST methods but IDK how to use them in NodeJs nor in the website as I am still new to it, so what I want is to send a packet of data from the website after a submit button and the bot which is hosted locally with the website will receive this data and work with it.
Express is a commonly used web framework for Node that takes care of routing fairly easily. You can see their documentation here.

How to setup action on Google API on local server?

I am new for action for Google, and I want a help. I want to create a chatbot and wanna use actions on Google API for this, I came across certain blogs but I can not understand how to setup this thing and local and make use of actions on Google API's in a productive way. I have read the documentation but nothing seems to be work in a desired manner. Please help me with initial steps where I could begin with.
I think you should read the documents properly. Here's the correct address for developing actions :- https://developers.google.com/actions/apiai/
This is the perfect document, if you will use API.ai. If you want to learn faster then you have to watch videos. Here is the link for the basic video.
This is the basic video you need to watch :- https://youtu.be/5Al0bfCF-xA
I think this video will help you alot. If still you need some more help for building apps, do reply we will help !
You can test it on your local server by opening up a port on your wifi router and and forward that port to you server ip and port. However, you still https call from api.ai to your local server.

facebook messanger -wit.ai integration -Chatbot -heroku deployed

I am working towards a chatbot,with wit.ai and facebook messanger as the interface for it,The integrating process went error less and the curl -H gave
{success:true},but the bot does not respond if messaged,I looked all over it,may i know is it because of heroku for which this behaviour is seen,or the deployment platform does not matter at all,what can be the area or part that i may be missing out?
List of things i have already done:
1 create a story over wit.ai
2 a simple nodejs server code printing ("this is a bot").
3 after properly executing,wrote the whole bot.
4 deployed it to heroku
5 in Facebook Developer section,created apps for messanger.
6 setup webhook,after creating a verify_token,it shows "complete"
7 generate page token and put verify_token and page_access_token in heroku dashboard's "config vars"
8 subscribe the page
9 trigger it using curl and chat with the bot;**
*error: bot does not respond in the page
url/webhook -> bad request*
Can anyone give me some suggestions regarding this
I find it highly unlikely that there is a heroku problem. Did you try chatting with the bot without using witai? Also type heroku logs on terminal to see if there are some errors in your application. I used heroku to deploy my chatbot, and it works really well since you can find all the errors in the logs. I am not well versed with witai, but since it is just calling the bot, heroku shouldn't be the one causing the error

Resources