Hi i have this problem quite long and have no idea how to deal with it. I want to program run sth like this :
- user write command in discord with argument (amount)
- discord function will call read_coupon function with written argument
- read_coupon function will open and read lines (depend of amount) and return it from txt file
atm my code ignore user input and return only first line in kody.txt
@client.command()
async def kody (ctx, amount):
await ctx.send(read_coupon(int(amount)))
def read_coupon(amount):
x_range = range(0,amount,1)
kody_open = open("kody.txt","r")
for line_kod in kody_open:
kody_lista.append(line_kod)
for x in x_range:
for element in kody_lista:
return element
kody.txt
NLZGQEJ32W
NLBH9LBZVP
NLB6DRBZ4Q
NLJ8GWAC8M
NLBH9LBZVP
NLB6DRBZ4Q
NLJ8GWAC8M