PagerMaid_Plugins/keyword_func/ranstr.py

15 lines
307 B
Python
Raw Normal View History

2021-02-07 04:03:12 +00:00
import random
import string
2021-02-07 04:06:31 +00:00
async def main(context):
2021-02-07 04:03:12 +00:00
try:
length = int(context.text.split()[1])
except:
length = 8
if length > 1000:
length = 100
s = ""
for i in range(length):
s += random.choice(string.ascii_letters + string.digits)
2021-02-07 04:06:31 +00:00
return f"`{s}`"