简体   繁体   English

错误 429,请求过多。 当我试图让我的 python discord 24/7 重复时

[英]Error 429, Too many requests. When I was trying to keep my python discord 24/7 on replit

import discord
import keep_alive
TOKEN = ""
with open("bot.env", "r+") as file:
  content = file.read()
  lvl2 = content.split("=")
  TOKEN = lvl2[1]
SERVER_NAME = "CHAMP's SMP"
client = discord.Client()    
@client.event
async def on_ready():
    for guild in client.guilds:
        if guild.name == SERVER_NAME:
            break
    print(f'{client.user} has connected to:\n'
            f'{guild.name}(id: {guild.id})'
          )

@client.event
async def on_message(message):
    if message.author == client.user:
        return
    if "Hi" in message.content or "Hello" in message.content:
        await message.channel.send("Hallo!")
    if "Happy Birthday" in message.content:
        await message.channel.send("Happy Birthday! ummm.... Whoever😅")
    if "Bye" in message.content:
        await message.channel.send("Bye, Guess I\'ll have to stay here...")
    if "$server" == message.content:
        await message.channel.send("""
-Cracked: Yes
-Joining Discord is mandatory
-Don't just join the server for once, need to be regular.
-No swearing
-No hacking
-IP: champ_99.aternos.me
-Port: 43075
-Build Your kingdoms and have wars
-This bot is currently in development
""")
    if "Good" in message.content and str(client.user.id) in message.content:
        await message.channel.send("Glad to see that you are glad from the work I just did. :-)")

    if str(client.user.id) in message.content:
      if "age" in message.content:
        await message.channel.send("I am a bot, we don't have ages. Though my master @Champ is 14 years old.")
      elif "name" in message.content:
        await message.channel.send("My name is Champ SMPee, as you can see")
      else:
        await message.channel.send("Yes? please type $help for more information.")
    if "$help" in message.content:
      await message.channel.send("""
      -> 
      """)

keep_alive.keep_alive()
client.run(TOKEN)
print("Bot started!")

That is all the code.这就是所有的代码。 When I run it, it shows a lot of html code with a message which says "Error 429 Too many requests".当我运行它时,它显示了很多 html 代码和一条消息,上面写着“错误 429 请求太多”。 I am using uptimer bot for updating and even tried changing the port of the keep_alive.py file.我正在使用 uptimer bot 进行更新,甚至尝试更改 keep_alive.py 文件的端口。 Any help will be appreciated.任何帮助将不胜感激。 Thank You谢谢你

If you are using repl.it, enter kill 1 in the shell which is next to the console tab.如果您使用的是 repl.it,请在控制台选项卡旁边的 shell 中输入kill 1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python HTTP 错误 429(请求过多) - Python HTTP error 429 (Too Many Requests) 如何避免 HTTP 错误 429(请求过多)python - How to avoid HTTP error 429 (Too Many Requests) python 如何使用 Asyncio 避免错误 429(请求过多)python - How to avoid error 429 (Too Many Requests) python with Asyncio 当我运行我的测试 discord 机器人时,我不断收到错误消息 - I keep getting an error in replit when im running my test discord bot 错误(429)在Python中使用geopy进行地理编码时请求太多 - error (429) Too Many Requests while geocoding with geopy in Python HTTPError:429 客户端错误:IBM Cloudant 上使用 python 的请求过多 - HTTPError: 429 Client Error: Too Many Requests on IBM Cloudant with python 使用带有 Python 脚本的 Instagram API 时出现“429 错误:请求过多” - '429 error: too many requests' when using Instagram API with Python script {'message': 'Too Many Requests', 'error': 429} 错误 - {'message': 'Too Many Requests', 'error': 429} error 为什么我不断收到“429 Too Many Requests”来请求将成员添加到 Twitter API 上的列表? - Why do I keep getting '429 Too Many Requests' for put requests to add members to a list on Twitter's API? 如何使用 python 执行谷歌搜索而不会出现 429 错误(请求太多) - How to perform google search with python without 429 error (too many requests)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM