Certificate Verification Error 1123 discord.py - discord.py

I have tried to make a simple discord but but i am getting this error
ClientConnectorCertificateError(aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True[SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certific
Heres my code
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='>')
#bot.command()
async def ping(ctx):
await ctx.send('pong')
bot.run('token')
token is my discord token
I have tried to upgrade certifi and discord.py
and searched stack overflow and the issues page in discord.pys github repo
Plz help
Thanks

Try to use discord.Client instead of commands.bot. I got this error too and that was the only solution that worked fine.

Related

Laravel websockets throwing curl error when trying to publish an event

Good day everyone, i have setup laravel websockets but when i try to publish a public event i get this curl error
cURL error 77: error setting certificate verify locations:\n CAfile: /etc/ssl/certs/ca-certificates.crt\n CApath: /etc/ssl/certs..
if i change the filename of my certs to ca-certificates.crt.. the websocket wont connect and when i try to publish event, it throws the curl error
Pusher error: cURL error 35: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure..
What do i need to do to solve this...Thanks

Strange problems with bot on Heroku

my bot stationes on heroku behave strangely, since seems to work perfectly in private, but in group only works with new users and stopped working with me and other collaborators who used it often.
I ran a logs and got these errors. Anyone can help? Thank you!
raise ApiTelegramException(method_name, result, result_json)
2020-11-13T20:40:42.207588+00:00 app[worker.1]:
telebot.apihelper.ApiTelegramException: A request to the Telegram API
was unsuccessful. Error code: 400 Description: Bad Request: have no
rights to send a message 2020-11-13T20:40:42.207589+00:00
app[worker.1]: " 2020-11-13T20:40:42.207869+00:00 app[worker.1]:
2020-11-13 20:40:42,207 (init.py:455 MainThread) ERROR - TeleBot:
"A request to the Telegram API was unsuccessful. Error code: 400
Description: Bad Request: have no rights to send a message"
raise ApiTelegramException(method_name, result, result_json)
2020-11-14T18:35:25.247259+00:00 app[worker.1]:
telebot.apihelper.ApiTelegramException: A request to the Telegram API
was unsuccessful. Error code: 400 Description: Bad Request:
CHAT_WRITE_FORBIDDEN 2020-11-14T18:35:25.247268+00:00 app[worker.1]: "
2020-11-14T18:35:25.247577+00:00 app[worker.1]: 2020-11-14
18:35:25,247 (init.py:455 MainThread) ERROR - TeleBot: "A request
to the Telegram API was unsuccessful. Error code: 400 Description: Bad
Request: CHAT_WRITE_FORBIDDEN"
Does the bot have Administrator rights in your group?
Seems like the bot is simply not allowed to send messages.

YouTube Data API Build Function doesn´t work

friends.
Yesterday I used the below python piece of code to retrieve some comments on youtube videos sucessfully:
!pip install --upgrade google-api-python-client
import os
import googleapiclient.discovery
DEVELOPER_KEY = "my_key"
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"
youtube = googleapiclient.discovery.build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=DEVELOPER_KEY)
youtube
It seems that the build function is suddenly not working. I have even refreshed the API, but in Google Colab I keep receiving the following error message:
UnknownApiNameOrVersion Traceback (most recent call last)
<ipython-input-21-064a9ae417b9> in <module>()
13
14
---> 15 youtube = googleapiclient.discovery.build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=DEVELOPER_KEY)
16 youtube
17
1 frames
/usr/local/lib/python3.6/dist-packages/googleapiclient/discovery.py in build(serviceName, version, http, discoveryServiceUrl, developerKey, model, requestBuilder, credentials, cache_discovery, cache, client_options)
241 raise e
242
--> 243 raise UnknownApiNameOrVersion("name: %s version: %s" % (serviceName, version))
244
245
UnknownApiNameOrVersion: name: youtube version: V3
If anyone could help. I´m using this type of authentication because I dont know to put the credentials file in google drive and open it in Colab. But it worked yesterday:
Results for yesterday´s run
Thank you very much in advance. And sorry for anything, Im new in the community.
Regards
The problem is on the server side as discussed here. Until the server problem is fixed, this solution may help (as suggested by #busunkim96):
First, download this json file: https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest
Then:
import json
from googleapiclient import discovery
# Path to the json file you downloaded:
path_json = '/path/to/file/rest'
with open(path_json) as f:
service = json.load(f)
# Replace with your actual API key:
api_key = 'your API key'
yt = discovery.build_from_document(service,
developerKey=api_key)
# Make a request to see whether this works:
request = yt.search().list(part='snippet',
channelId='UCYO_jab_esuFRV4b17AJtAw',
publishedAfter='2020-02-01T00:00:00.000Z',
publishedBefore='2020-04-23T00:00:00.000Z',
order='date',
type='video',
maxResults=50)
response = request.execute()
I was able to resolve this issue by putting making putting static_discovery=False into the build command
Examples:
Previous Code
self.youtube = googleapiclient.discovery.build(API_SERVICE_NAME, API_VERSION, credentials=creds
New Code
self.youtube = googleapiclient.discovery.build(API_SERVICE_NAME, API_VERSION, credentials=creds, static_discovery=False)
For some reason this issue only arised when I compiled my program using Github Actions

Google Assistant Hotword Detection Not Working

I'm new to Google Assistant SDK. Recently I embedded Assistant to Raspberry Pi 3 B. I used the googlesamples-assistant-hotword sample. It worked fine. But next time I run the command I got some errors. I reinstall the sdk and tried, but got the same error. However googlesamples-assistant-pushtotalk still works. But googlesamples-assistant-hotword gives errors. How can I fix this. The errors I got are as follows;
(env) pi#raspberrypi:~$ googlesamples-assistant-hotword
ON_MUTED_CHANGED:
{u'is_muted': False}
ON_START_FINISHED
E0922 08:01:19.189206804 9868 handshake.c:128] Security handshake failed: {"created":"#1506047479.189164282","description":"Handshake read failed","file":"../../third_party/grpc/src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"#1506047479.189160249","description":"FD shutdown","file":"../../third_party/grpc/src/core/lib/iomgr/ev_epoll_linux.c","file_line":1045}]}
E0922 08:01:20.189959242 9868 handshake.c:128] Security handshake failed: {"created":"#1506047480.189916251","description":"Handshake read failed","file":"../../third_party/grpc/src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"#1506047480.189911706","description":"FD shutdown","file":"../../third_party/grpc/src/core/lib/iomgr/ev_epoll_linux.c","file_line":1045}]}
E0922 08:01:21.190931499 9868 handshake.c:128] Security handshake failed: {"created":"#1506047481.190904069","description":"Handshake read failed","file":"../../third_party/grpc/src/core/lib/security/transport/handshake.c","file_line":237,"referenced_errors":[{"created":"#1506047481.190900454","description":"FD shutdown","file":"../../third_party/grpc/src/core/lib/iomgr/ev_epoll_linux.c","file_line":1045}]}
[9782:9800:ERROR:speech_recognition_activity.cc(550)] S3 connection has timed out: No data from S3

pip can't find distributions from within virtualenv

I set up a new virtualenv. From within it, pip cannot find any distributions. Outside of the env, it can. Here's the output:
(wagon-admin)[me#pjs-macbook-pro wagon-admin]$ pip install Django
Downloading/unpacking Django
Could not fetch URL https://pypi.python.org/simple/Django/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:480: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>
Will skip URL https://pypi.python.org/simple/Django/ when looking for download links for Django
Could not fetch URL https://pypi.python.org/simple/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:480: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>
Will skip URL https://pypi.python.org/simple/ when looking for download links for Django
Cannot fetch index base URL https://pypi.python.org/simple/
Could not fetch URL https://pypi.python.org/simple/Django/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:480: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm>
Will skip URL https://pypi.python.org/simple/Django/ when looking for download links for Django
Could not find any downloads that satisfy the requirement Django
No distributions at all found for Django
Storing complete log in /Users/me/.pip/pip.log
I'm on OSX, and created the virtual environment using virtualenvwrapper. $ mkvirtualenv <env name>
This happens for all packages, not just django.
Edit: Only similar thing I've found in my searching: https://github.com/pypa/pip/issues/829
I had the same problem but realized I hadn't activated my virtualenv. Once I activated it, the installation worked. Not sure why.
Looking at the command line you pasted, it looks like you activated your env, but just wanted to note this for others who happen to stumble across this.
I updated to python 2.7 and everything works fine now.

Resources