#๐ help
16 messages ยท Page 1 of 1 (latest)
@dire lantern
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.
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)
Hey @dire lantern!
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
@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
@dire lantern did you write this code fully urself?
what is await ensure_user_row(ctx.author.id) trying to do?
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.