我试图使用多个用户提到,而message.mention.members.first()不能这样做。所以我做了一些调查,并从中找到了这个函数
function getUserFromMention(mention) {
if (!mention) return;
if (mention.startsWith('<@') && mention.endsWith('>')) {
mention = mention.slice(2, -1);
if (mention.startsWith(
我无法理解以下代码中的控制流:
class Television {
private int channel=setChannel(7);
public Television (int channel) {
this.channel=channel;
System.out.println(channel + "");
}
public int setChannel(int channel) {
this.channel=channel;
System.out.print(chan
我有一个命令,我想把它限制在特定的级别。我使用的是unreal3.2.6 IRC。
我读到了这个:
但我仍然不确定我能做些什么来检查用户排名。
我想看看用户是不是一个“声音”或更高的人。什么可以查找用户,我可以做什么来检查他们是否是语音或更高的人?为了让我检查,每个排名的值是什么?
我只想检查当前的频道,而不是整个IRC服务器。
例如:
当用户尝试执行命令!roll (Rolls a dice)并且不是语音或更高级别时,将不会发生任何事情。
if (data.Equals("!roll"))
{
//Check if user contains (@,+,etc?
我保证我什么都试过了。我想我已经有了实际的命令,但是我不知道如何实现语音通道的名称。下面是我的代码:
if (!message.mentions.users.first()) {
message.channel.send("You have to tag someone my dude.")
break;
}
var member = (message.mentions.users.first())
guild.member(member).setVoiceChannel(Rats)
message.channel.send(
我希望当用户加入这个临时通道时,将该通道重命名为他的Name#0000 - Discord_ID,并在离开这个临时vc时将其删除。怎么做呢?
client.on('voiceStateUpdate', (oldState, newState) => {
if (newState.channelID === 'channelID') { // You can also use `newState.channelID`
newState.guild.channels.create("Tester", {