Bots that use UptimeRobot keeps getting rate limited - python

I used UptimeRobot and it worked well until about March 2022. Nowdays, my bots keep getting rate limited for some reason. I have 8 bots using UptimeRobot right now, currently two bots have been down since 22th March 2022 which is a total of 319 days. According to UptimeRobot, the cause is a 404 not found.[
Btw I'm using nextcord (a fork of discord.py)
If you're gonna suggest another website, please make sure you don't need to pay to use it.
If you need more information/my text was unclear, please leave a comment.
Thanks.
EDIT: Some of my bots are up in UptimeRobot, but ain't online in discord.

When multiple users host their Bots in the same site (for example replit) they all share similar IPs (I will not explain this in detail)
What is happening is that the Discord API is ratelimiting the IP where your Bot is running. However, the webserver does not crash on Bot's errors (such as 429) so the site will be still online for uptime robot.
I would suggest to look for other free hosts but where you need a credit card to use the service (e.g. oracle cloud)

Related

Is it possible to make a python bot that sends Youtube live chat messages?

I'm trying to make a youtube bot for a friend who streams often. I already looked into pytchat, which worked pretty well in retrieving chat messages, but I don't think it has a way to send messages. I'm not sure if this is even possible.
It is completely possible.
Taking a brief look at pytchat, indeed it looks like it has no way to send messages.
But there is an official API to post messages. Depending on your experience level, you may find it easy to use it.
There are several ressources (YouTube videos, medium articles, ...) that explain how to use the API to build a rudimentary bot.

Is there a way to make a site to display the uptime and output of a long running python program

I have multiple discord bots that I make and host for people. I was looking to make a page on my website to show the stdout, stderr and uptime of each of my bots on this page.
Each bot runs in a separate "screen", which is created using the screen package as provided: here
I can easily pipe the stdout and stderr to any file if needed.
I am running ubuntu 18.04 and I personally own the machine so there are little to no limitations on what I am able to do with it.
My python version is: Python 3.6.4
The discord bot API is discord.py v1.4.1 (rewrite) as seen: here
v1.5.0 is newly released so I'm waiting to update to it, while checking the changelog I didn't notice anything that could affect this project so there should be no issues
I am not concerned about the layout of the website as all styling will be done later, I just want to see if there is a way that I can take the values specified above and put them in a web page. I have some experience in js and am quite experienced in theoretical knowledge, so not knowing exactly how to code in it shouldn't be too much of a problem (I hope)
I have searched around for a while but couldn't find any solutions. Hope someone here can help :)
Uptime monitoring websites is not directly a feature of discord.py, because it would add a whole layer of complexity 😔.
You can write your own HTTP web server to serve your website's content (ie. to keep track of uptime, downtime, etc. by yourself 😫), but that would probably end up being overly complicated.
If you don't want this extreme complexity, you can use ⚒️ UptimeRobot (not affiliate link) to create a status page for you. All you have to do is open an HTTP endpoint on the same server that's running your Discord bot (preferably in the same process, maybe a different thread), so UptimeRobot knows when your Discord bot comes 🟢 online and goes 🔴 offline.
To create the HTTP endpoint, you can use the built in http.server module, or 🛠️ Flask. Note that, in order for UptimeRobot to make a connection with the server hosting the Discord bot, port forwarding needs to be done. If you don't have access to the network, you can use a service like 🧰 ngrok to publicly expose the port the server is running on.
All services mentioned above are free 🤑, and are not affiliate links. 🤗

Suggestion: The best way to send messages on Facebook without getting banned using python

I'm using a python script that monitors a website and sends me messages on Facebook if there is any specific updates.
I have tried a module which called 'fbchat', so simple and so easy, but the problem is that I'm using real Facebook accounts and somehow Facebook detected that it's a bot and banned that profile, even if I have made random pauses in my code.
I know that I can do make those notifications through emails, but for me Facebook messages are better... Any ideas about how can I make it possible (maybe through bots!!)?
Thank you!
First take a look at which parameters(headers and payloads) the POST method takes(using network tools in google chrome for example), and try again with as many parameters as possible, while also using a session so cookies are enabled as well.
Different websites use different methods of detecting bots, and you'll just have to test and see what works.
P.S: take a look at this answer for more info.
Multiple Accounts are not allowed on Facebook, and there is no (allowed) way to send messages between users. You can only send messages from Pages to Users, and only if the User started the conversation. You can find more information about that in the docs: https://developers.facebook.com/docs/messenger-platform/

Gathering bug reports?

Premise: I am a beginner in search for an easy way to send bug reports from users over sea.
I've made a script for some friends that are living on the other side of the sea (US - EUROPE)... I will like to gather automatic bug reports whenever they happen. So my first idea was to send myself an email with the smtplib module. It works fine when testing home, but as soon as the sender "sends", my email provider (gmail) blocks the connection because of course, its from an "unknown device". I've already enabled "Allow less secure apps" as someone suggested but with no avail.
What I am searching its a simple way of dealing with this.
Yes I could make the script to ignore the error if the email its not being sent, and then go into my google account and enable those devices so at least it will work from the second run..
But it doesn't seem what a programmer would do in this case. I am learning so a solution withing the language is what I am after.
A different provider that has no restriction its also a good start but I tried Yahoo, Live, Yandex but I couldn't make them work. Are there any?
So my question is: how others do? what is the best solution for some one like me?
I've read about sentry or other error/bug tracking but its obviously way too much for want I need
You should certainly not incorporate e.g. Gmail credentials in the code that is remotely executed on devices you do not control, given I understand correctly the Gmail less secure device issue happens as every "user" is running this code and using your credentials. This holds true for any other provider.
Now this won't exactly be simple but one way to go about it would be to create a server side API endpoint that can accept HTTP(s) or any other protocol requests that then will authenticate in a little more secure way on the server side with Gmail.
The concept for emails is:
Bug > Python Script > API call > Email
This could be implemented using Python on the API side (Flask e.g.) using an AWS Lambda Function with Amazon API Gateway, but again that is something to get through and understand by itself which will take a good chunk of time.
You need to touch a lot of concepts, like auth tokens to make this really secure.
Could you elaborate a little on where the code needs to run and if you are willing to try AWS or any other cloud provider, or would have access to an internet connected server ? This makes it easier to provide you with a full example on the solution in a hackish way while I would highlight the problems you could face on the security side.
I understand that this is not the way to go but as for my needs and my level of experience it works for me!
Yandex allows you to send email from different ip so Yandex is the way to go. What I was doing wrong in the first place was to use the wrong port (587 instead of 465)

How can I use the WhatsApp API from Java or Python? [duplicate]

This question already has an answer here:
Does WhatsApp offer APIs?
(1 answer)
Closed last month.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I am looking for WhatsApp API, preferably a Python or Java library.
I've tried Yowsup, but could not get my number registered; I am based in India and I am not sure if that has got anything to do with it.
I did try WhatsAPI (Python library) but it is not working either.
Any suggestions about this? Any users of Yowsup here?
After trying everything, Yowsup library worked for me. The bug that I was facing was recently fixed. Anyone trying to do something with Whatsapp should try it.
From my blog
courtesy
There is a secret pilot program which WhatsApp is working on with selected businesses
https://faq.whatsapp.com/general/26000052
News coverage:
https://yourstory.com/2017/09/app-fridays-whatsapp-for-business-bookmyshow/
https://yourstory.com/2017/09/bookmyshows-product-team-decrypts-how-whatsapp-for-business-works/
http://indianexpress.com/article/technology/social/now-get-bookmyshow-ticket-confirmation-message-on-whatsapp-4844869/
http://gadgets.ndtv.com/apps/news/whatsapp-business-bookmyshow-pilot-1750740
For some of my technical experiments, I was trying to figure out how beneficial and feasible it is to implement bots for different chat platforms in terms of market share and so possibilities of adaptation. Especially when you have bankruptly failed twice, it's important to validate ideas and fail more faster.
Popular chat platforms like Messenger, Slack, Skype etc. have happily (in the sense officially) provided APIs for bots to interact with, but WhatsApp has not yet provided any API.
However, since many years, a lot of activities has happened around this - struggle towards automated interaction with WhatsApp platform:
Bots App
Bots App is interesting because it shows that something is really tried and tested.
Yowsup
A project still actively developed to interact with WhatsApp platform.
Yallagenie
Yallagenie claim that there is a demo bot which can be interacted with at +971 56 112 6652
Hubtype
Hubtype is working towards having a bot platform for WhatsApp for business.
Fred
Fred's task was to automate WhatsApp conversations, however since it was not officially supported by WhatsApp - it was shut down.
Oye Gennie
A bot blocked by WhatsApp.
App/Website to WhatsApp
We can use custom URL schemes and Android intent system to interact with WhatsApp but still NOT WhatsApp API.
Chat API daemon
Probably created by inspecting the API calls in WhatsApp web version. NOT affiliated with WhatsApp.
WhatsBot
Deactivated WhatsApp bot. Created during a hackathon.
No API claim
WhatsApp co-founder clearly stated this in a conference that they did not had any plans for APIs for WhatsApp.
Bot Ware
They probably are expecting WhatsApp to release their APIs for chat bot platforms.
Vixi
They seems to be talking about how some platform which probably would work for WhatsApp. There is no clarity as such.
Unofficial API
This API can shut off any time.
And the number goes on...
WhatsApp Inc. does not provide an open API but a reverse-engineered library is made available on GitHub by the team Venomous on the GitHub. This however according to my knowledge is made possible in PHP. You can check the link here: https://github.com/venomous0x/WhatsAPI
Hope this helps

Categories