I host my bot on replit, for the past week my bot is getting rate limited pretty often. In replit we fix rate limits by using kill 1
in shell. So I want my bot to automatically execute kill 1
every time it gets rate limited.
I've already tried this:
client = commands.Bot(command_prefix='!')
try:
@client.event
async def on_message(message):
if message.author == client.user:
return
if "give me admin" in message.content:
role = get(message.guild.roles, name='Admin')
await message.author.add_roles(role)
if 'yeet' in message.content:
print('YEETT')
except:
print("kill 1")
subprocess.call("kill 1", shell=True)
I'm new to python so idk if I'm using try/except command at the right place