#๐Ÿ”’ help

16 messages ยท Page 1 of 1 (latest)

dire lantern
#

how to addd

indigo baneBOT
#

@dire lantern

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

dire lantern
#

hi

#

so

#

how can i add the number

#

of the working cmd

#

in to the bal

#

@bot.command(aliases=["work"])
@commands.cooldown(1, 1, commands.BucketType.user) # 1 hour cooldown
async def working(ctx):
jobs = [
("cleaned Floppaโ€™s litterbox", random.randint(50, 100)),
("Begged Elon Mucks", random.randint(80, 10000)),
("sold memes to Big Floppa", random.randint(100, 200)),
("guarded the cat kingdom", random.randint(120, 250)),
("coded a bot for Floppa", random.randint(150, 300)),
]
job, earned = random.choice(jobs)

async with aiosqlite.connect("economy.db") as db:
    await db.execute("UPDATE users SET wallet = wallet + ? WHERE user_id = ?", (earned, ctx.author.id))
    await db.commit()

embed = discord.Embed(
    title="๐Ÿ˜บ CatJob Complete!",
    description=f"You **{job}** and earned **{earned} CatCoins**!",
    color=discord.Color.gold()
)
await ctx.send(embed=embed)
await ensure_user_row(ctx.author.id)
indigo baneBOT
#

Hey @dire lantern!

Please edit your message to use a code block

```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
dire lantern
#
@bot.command(aliases=["work"])
@commands.cooldown(1, 1, commands.BucketType.user)  # 1 hour cooldown
async def working(ctx):
    jobs = [
        ("cleaned Floppaโ€™s litterbox", random.randint(50, 100)),
        ("Begged Elon Mucks", random.randint(80, 10000)),
        ("sold memes to Big Floppa", random.randint(100, 200)),
        ("guarded the cat kingdom", random.randint(120, 250)),
        ("coded a bot for Floppa", random.randint(150, 300)),
    ]
    job, earned = random.choice(jobs)

    async with aiosqlite.connect("economy.db") as db:
        await db.execute("UPDATE users SET wallet = wallet + ? WHERE user_id = ?", (earned, ctx.author.id))
        await db.commit()

    embed = discord.Embed(
        title="๐Ÿ˜บ CatJob Complete!",
        description=f"You **{job}** and earned **{earned} CatCoins**!",
        color=discord.Color.gold()
    )
    await ctx.send(embed=embed)
    await ensure_user_row(ctx.author.id)
#

how to add

#

the money their

#

in to the bal

clear canopy
#

@dire lantern did you write this code fully urself?

what is await ensure_user_row(ctx.author.id) trying to do?

indigo baneBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.