[英]I want a bot to send random messages only but one message only once
It Is Something Like This是这样的
I have these 5 messages我有这 5 条消息
hello1 hello2 hello3 hello4 hello5你好1 你好2 你好3 你好4 你好5
And I want to send a random message我想发送一条随机消息
like hello3像你好3
But It Could Be Sent Only Once但它只能发送一次
I mean At first it send hello3 And After hello3 Could Not Be Sent我的意思是一开始它发送 hello3 之后 hello3 无法发送
I know this is crazy我知道这很疯狂
its like this就像这样
hello3 sent hello3 发送
And Next Time hello5 sent But Next Time hello3 Could Not Be Sent下一次 hello5 已发送,但下一次 hello3 无法发送
I want to do this in discord.js v14我想在 discord.js v14 中执行此操作
Your post is kinda confusing, but if you wanted to send a random message, use an array.您的帖子有点令人困惑,但是如果您想发送随机消息,请使用数组。
let randomStrings = ["message1", "message2", "message3", "message4", "message5"];
let randomLength = randomStrings.length;
let RN = Math.floor(Math.random() * randomLength);
let sendRandomString = randomStrings[RN]
Here's the snippet:这是片段:
let randomStrings = ["message1", "message2", "message3", "message4", "message5"]; let randomLength = randomStrings.length; let RN = Math.floor(Math.random() * randomLength); let sendRandomString = randomStrings[RN] console.log(sendRandomString)
Since you don't provide any code of yours.因为你没有提供你的任何代码。 This is only the code I can give as tips.这只是我可以作为提示提供的代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.