当用户切换频道时,我正在尝试将漫游器从一个频道移动到另一个频道
const client = require("../index.js");
module.exports = client => {
client.on("voiceStateUpdate", (oldState, newState) => {
let oldChannel = oldState.voiceChannel, // the previous channel, if there was one
newChannel = newState.voiceChannel; // the current channel, if there is one
if (oldChannel != newChannel) {
// if the channel has changed
// do your stuff....
channel = msg.member.voice.channel
channel.join()
}
});
}
答案 0 :(得分:0)
您只需要使用train_transforms = transforms.Compose([transforms.RandomRotation(10),
transforms.RandomResizedCrop(224),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406],
[0.229, 0.224, 0.225])])
test_transforms = transforms.Compose([transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406],
[0.229, 0.224, 0.225])])
train_image_dataset = datasets.ImageFolder(data_dir, transform=train_transforms)
test_image_dataset = datasets.ImageFolder(data_dir, transform=test_transforms)
train_dataloader = torch.utils.data.DataLoader(train_image_dataset, batch_size=64, shuffle=True)
test_dataloader = torch.utils.data.DataLoader(test_image_dataset, batch_size=32)
的{{1}}
newState