T
T
tatsuki12021-11-05 19:58:57
Python
tatsuki1, 2021-11-05 19:58:57

MongoDB error, googled, did not find, help?

Greetings. I am writing a Blacklist system. And I want to add a user to the database, but it gives me an error. Below code and error

@commands.command()
    async def blacklist(self, ctx, id, reason='Ну типо захотел'):
        if id is None:
            await ctx.send('Введите ид пользователя', delete_after=10)
        else:
            user = await self.client.fetch_user(id)
            bl = discord.Embed(color=discord.Colour.random(), description=
            f'{user} был добавлен в чёрный список бота\n'
            f'Причина: {reason}'
            )
            bl.set_author(name='Blacklist system')
            bl.set_footer(text=f'ID:{id}')
            await ctx.send('Готово', embed=bl)
            collection.insert_one({"id":id, "reason":reason})


error:
Command raised an exception: OperationFailure: bad auth : Authentication failed., full error: {'ok': 0, 'errmsg': 'bad auth : Authentication failed.', 'code': 8000, 'codeName': ' AtlasError'}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
seira-code, 2021-11-06
@seira-code

Most likely your link to connect to Mongo is not correct

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question