I have semi-completed what I wished to do. However, this is not the final thing because there is an error messaged:
DiscordAPIError: Unknown Channel
at RequestHandler.execute (C:Usersjonas
ode_modulesdiscord.jssrc
estRequestHandler.js:154:13)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async RequestHandler.push (C:Usersjonas
ode_modulesdiscord.jssrc
estRequestHandler.js:39:14) {
method: 'post',
path: '/channels/801898492082782310/invites',
code: 10003,
httpStatus: 404
I am unsure what the reason for the error in getting the correct channel but I'll reply to this with the full code when I have solved the problem.
run : function(msg, client, cmds, disc, args){
//console.log("1");
client.guilds.create("New Guild")
.then(value => {
let channel = value.channels.cache.first();
let invite = channel.createInvite({
maxAge: 0, // 0 = infinite expiration
maxUses: 0 // 0 = infinite uses
})
.then(result => {
console.log(result);
})
.catch(console.error);
console.log(invite.url);
})
.catch(console.error);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…