Discord.py как я могу получить число из mongodb?

Я пытаюсь получить число и присвоить его к пользователю ,но консоль выдаёт ошибку ,как это исправить?

Код создания промокода:

    @commands.command(aliases = ['create-promocod', 'создать-промокод', 'создать_промо'])
    @commands.is_owner()
    async def create_promo(self, ctx, summo: int = None, ispols: int = None, promo: int = None):
            err = discord.utils.get(self.client.emojis, name='no')
            tru = discord.utils.get(self.client.emojis, name='yes')
        
            if not self.collservers.count_documents({"guild_id": ctx.guild.id}):
                post = {
                    "guild_id": ctx.guild.id,
                    "promocod": {"promo": promo, "summo": summo, "ispols": ispols}
                }

                self.collservers.insert_one(post)
            elif summo is None:
                embed = discord.Embed(
                    title=f'{err} Ошибка!',
                    description = f"Укажите сумму для выдачи!",
                    colour=err_color
                    )
                await ctx.send(embed=embed)
            elif ispols is None:
                embed = discord.Embed(
                    title=f'{err} Ошибка!',
                    description = f"Укажите количество использований!",
                    colour=err_color
                    )
                await ctx.send(embed=embed)
            elif ispols is None:
                embed = discord.Embed(
                    title=f'{err} Ошибка!',
                    description = f"Укажите количество использований!",
                    colour=err_color
                    )
                await ctx.send(embed=embed)
            elif promo is None:
                embed = discord.Embed(
                    title=f'{err} Ошибка!',
                    description = f"Укажите промокод!",
                    colour=err_color
                    )
                await ctx.send(embed=embed)
            else:
                embed = discord.Embed(
                    title=f'{tru} Успешно создан!',
                    description = f"Промокод: {promo} \nНа сумму: {summo} \nКоличество использований: {ispols}",
                    colour=discord.Color.green()
                    )
                await ctx.send(embed=embed)


Код использования промокода:

    @commands.command(aliases = ['promocod', 'промокод', 'промо'])
    @commands.is_owner()
    async def promo(self, ctx, amount: int = None):
            err = discord.utils.get(self.client.emojis, name='no')
            tru = discord.utils.get(self.client.emojis, name='yes')
        
            if amount is None:
                embed = discord.Embed(
                    title=f'{err} Ошибка!',
                    description = f"Укажите промокод!",
                    colour=err_color
                    )
                await ctx.send(embed=embed)
            else:
                eco = self.collservers.find({"guild_id": ctx.guild.id, "promocod": "summo"})["summo"]
                ispl = self.collservers.find({"guild_id": ctx.guild.id, "promocod": "ispols"})["ispols"]
                ecor = self.collection.find_one({"guild_id": ctx.guild.id, "user_id": ctx.author.id})
                ispos = ispl - 1
                ecore = ecor['balance'] + eco
                oipl = self.collservers.update_one({"guild_id": ctx.guild.id}, {'$set':{'balance': "ecore"}})
                splq = self.collservers.update_one({"guild_id": ctx.guild.id, "promocod": ["ispols"]}, {'$set':{"ispols": - 1}})
        
                embed = discord.Embed(
                    title=f'{tru} Успешно!',
                    description = f"Промокод активирован!\n**Сумма:** {eco}\n**Использований осталось:** {splq}",
                    colour=discord.Color.green()
                    )
                await ctx.send(embed=embed)

Ошибка из консоли:

введите сюда описание изображения


Ответы (0 шт):