【问题标题】:Discord Bot Python mentioningDiscord Bot Python 提到
【发布时间】:2021-07-18 17:47:42
【问题描述】:

我需要一个循环,在单独的消息中提及用户 x 次(x 是 0 到 1000 之间的随机选择) 已经试过了:

if message.content.startswith('$ZSEN'):
    await message.channel.send('MASZYNA LOSUJĄCA JEST PUSTA, I POSZŁO KURWA: ')
    for i in range(100):
        await message.channel.send(message.author.mention)  

【问题讨论】:

    标签: python discord bots mention


    【解决方案1】:

    如果你想得到一个随机数,你必须使用随机库

    使用

    random.randint(0, 1000)
    

    用于导入库from random import randint

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-31
      • 2021-08-30
      • 1970-01-01
      • 1970-01-01
      • 2018-07-08
      • 1970-01-01
      • 2020-07-15
      • 2018-10-21
      相关资源
      最近更新 更多