I am trying to make a command, where I can get every guild invite that the bot is currently in. Current code:
client.on('message', async (message) => {
if (message.content.startsWith(prefix + 'invite')) {
let invite = client.guilds
.createInvite({
maxAge: 0, // 0 = infinite expiration
maxUses: 0, // 0 = infinite uses
})
.catch(console.error);
message.channel.send(invite);
}
});
Error:
DiscordAPIError: Cannot send an empty message
