Skip to content

create_link()

Communicates with Discord API and returns the invite link for the specific application requested. Needs to be in an async function.

Parameters

voiceChannel_ID
ID of the voice channel that the invite link will point at.

Type: str or int
application
The VC activity/application that you want to create an invite for.

Type: str (for pre-defined applications) or int (for custom IDs)
Pre-defined applications
These are the applications/activities that currently come with the discord-together package.
These currently include:
Watch Togetheryoutube
Poker Nightpoker
Chess in the Parkchess
Letter Leagueletter-league
Word Snackword-snack
Sketch Headssketch-heads
SpellCastspellcast
Awkwordawkword
Checkers in the Parkcheckers
Blazing 8sblazing-8s
Land-ioland-io
Putt Partyputt-party
Bobble Leaguebobble-league
Ask Awayask-away
Use the text in the (brackets) as the application parameter

Activities that require at least Server Boost Level 1*



Custom application IDs
This is a advanced feature brought by the package which allows you to create links for applications that may not be included default. This option requires you to have the ID for the application. For example, YouTube Together uses the ID 880218394199220334.
So, if you do have the ID, you can use this option in the format that will be coming up under Examples.
max_age‌ ‌ kwarg-only yes
Duration in seconds after which the invite expires. Value has to be between 0 (Unlimited) and 604800 (7 days).

Type: int
Default: 86400 (24 hrs)
max_uses‌ ‌ kwarg-only yes
ID of the voice channel that the invite link will point at.

Type: int
Default: 0 (unlimited)

Returns

A str containing the invite link you requested for. (https://discord.gg/INVITE_CODE_HERE)


Examples

Creating a link for pre-defined applications

link = await client.togetherControl.create_link(VC_ID_HERE, 'youtube')
await channel.send(link)
Creating a link for custom applications using it's ID
link = await client.togetherControl.create_link(VC_ID_HERE, '000000000000000000')
await channel.send(link)

Creating a link with max_age keyword argument (kwarg)

link = await client.togetherControl.create_link(VC_ID_HERE, 'youtube', max_age = 3600)
await channel.send(link)

Creating a link with max_uses keyword argument (kwarg)

link = await client.togetherControl.create_link(VC_ID_HERE, 'youtube', max_uses = 5)
await channel.send(link)

Creating a link with both max_age and max_uses kwargs

link = await client.togetherControl.create_link(VC_ID_HERE, 'youtube', max_age = 3600, max_uses = 5)
await channel.send(link)


Warning

Remember, all of these VC activities are made/authorized by Discord and are currently in BETA. You can expect to see bugs and issues with the games sometimes. If you see a bug with Poker Night or Chess in the Park, you can report it on Discord's official "Game Lab" here.

If you misspell a pre-defined application name or enter an invalid application ID, don't worry! The package has a built-in exception for such cases. Let's take a look at all the exceptions next.

Back to top