Discord.py | Can A Bot Generate A Server Invite Link?
I was wondering if it is possible for a bot, to generate a Discord Server Link. Basically after I UnBan a discord user I want the bot to invite him back. I have not tried anything
Solution 1:
You can add the following to your Unban command to create a discord invite for that specific text channel and then send it to the user being unbanned:
# This will create the invite
invite = await ctx.channel.create_invite()
# This will send the user the invite via Private Message# You will need to have fetched the user previouslyawait user.send(invite)
You might also want to check the official discord.py documentation to check the optional parameters that you can pass to the create_invite()
method.
Reference of method create_invite
Post a Comment for "Discord.py | Can A Bot Generate A Server Invite Link?"