【问题标题】:Using Python to send messages in Discord使用 Python 在 Discord 中发送消息
【发布时间】:2022-01-05 09:19:36
【问题描述】:

是否可以制作一个 Python 程序,在 Discord 聊天中每 2 分钟发送一次消息,但其他用户无法看到它是一个程序?

【问题讨论】:

标签: python discord discord.py chat


【解决方案1】:

您可以使用以下代码让机器人每两分钟发送一次消息

from discord.ext import commands,tasks
@tasks.loop(seconds=120)
async def determine_winner():
  message=#Message to be sent
  channel_id=#Gives the id of channel where to send
  client.get_channel(channel_id).send(message)

如果您想通过多个渠道发送此消息。您应该获取要发送消息的每个通道的 id 并将其存储在数据库或 json 文件中并在发送消息时获取它。
But self-botting is against discord'sTOS if they found you self-botting they will ban you from discord permanently

【讨论】:

  • 感谢您的回答!但他们如何发现机器人?如果我现在和那时更改聊天之间的时间并插入一个包含许多不同消息要发送的 for 循环怎么办?例如,他们是否有追踪自我机器人的机器人,或者他们是否手动禁止机器人?
  • 让我用一个例子来解释你的问题:如果你使用autotyper for discord在不同的时间发送不同的消息,并尝试在超过 2 小时内获得更多的硬币,即使不和谐的 DankMemer 机器人检测到你是自我-botting 并禁止你使用他们的命令。由于 Dank Memer 检测到这种自我攻击,我相信如果您长时间使用自动打字机或类似的东西,discord 会找到您并禁止您的帐户
猜你喜欢
  • 2020-09-23
  • 2020-06-08
  • 2020-08-16
  • 2018-05-03
  • 2021-06-14
  • 2020-08-31
  • 2019-03-18
  • 2018-07-24
  • 2020-12-23
相关资源
最近更新 更多