Skip to content

Return only a number. #499

Answered by msiemens
Brncray asked this question in Q&A
Jan 8, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Would something like this fork for you?

results = db.search(User.id == ctx.options.member) 

if results == []:
    await ctx.respond("User doesn't exist... adding to database.")
    db.insert({"id": ctx.options.member, "bal": 0})
else:
    await ctx.respond(results[0].bal)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Brncray
Comment options

@msiemens
Comment options

@Brncray
Comment options

Answer selected by Brncray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants