Skip to content
Sign UpLog In
Profile icon

pavan

@chinnupavan48
Repls
Community
chinnupavan48
chinnupavan48
shared a Post
1 year ago
how can i take input for cooldowns?
i want to load an integer value from a json file using user.id how can i pass this in
Coder100
Coder100
I recommend using replit db instead for this job as json files do reset. It may not be today, but it will happen! Anyways, here is the db version: from replit import db def someFunctionToAddCooldown(id, amt): db[id] = amt def getCooldownFromUser(id): return db[id] `1 year ago
VulcanWM
VulcanWM
import json with open('example.json', 'r') as myfile: data=myfile.read() obj = json.loads(data) cooldown = obj.get(userid, None) if the userid has a cooldown, it will be the variable, if not, it will be equal to None This is the code to get the cooldown value from the json file1 year ago
chinnupavan48
chinnupavan48
shared a Post
1 year ago
how to know that how much of RAM,ROM,CPU is in use for this script ?
MocaCDeveloper
MocaCDeveloper
Hi! I believe there is the package psutil available. You will have to install it via pip(or pip3, depending). It's a simple installation: pip3 install psutil. Then, within your Python code(wherever you need it), just simply import it! There is some great documentation over this, but the most basic use is: import psutil print(psutil.cpu_percent(4)) I will briefly go over the above program: psutil.cpupercent gets the system-wide CPU utilization as a percentage. The arguments are interval = No1 year ago
chinnupavan48
chinnupavan48
shared a Post
1 year ago
I tried this .. async def oncommanderror(ctx,error): if isinstance(error,commands.CommandOnCooldown): s=error.retry_after mes=('Tr
MrVoo
MrVoo
Make your own function for it, like this. from time import sleep def sleep2(h,m,s): duration = s+ m60+ h3600 sleep(duration) `1 year ago
chinnupavan48
chinnupavan48
shared a Post
1 year ago
i am new to discord.py but i know python and i have started creating meme bot but i dont know how to send a post from a instagram page..please help me
CosmicBear
CosmicBear
You could use an api maybe https://developers.facebook.com/docs/instagram-basic-display-api. If that doesn't work try web-scraping using beautifulsoup. Also if telugumemes123 is your account, i may have logged into it. Use the .env system to keep that kind of data hidden.1 year ago
codingjlu
codingjlu
If Instagram doesn't have an API for this, web scraping is the way to go. I'm not sure exactly how Instagram works but you'll most likely have to use Selenium of Pyppeteer (or Puppeteer for Node.js, a much better option).1 year ago