Created
April 10, 2021 14:04
-
-
Save minibox24/0025c09ca3941fca541e31429f5bd019 to your computer and use it in GitHub Desktop.
discord.py activities invite generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
from discord.ext import commands | |
from discord.http import Route | |
bot = commands.Bot(command_prefix='!') | |
@bot.command('youtube') | |
async def youtube(ctx): | |
voice = ctx.author.voice | |
if not voice: | |
return await ctx.send('You have to be in a voice channel to use this command.') | |
r = Route('POST', '/channels/{channel_id}/invites', channel_id=voice.channel.id) | |
payload = { | |
'max_age': 0, | |
'target_type': 2, | |
'target_application_id': 755600276941176913 | |
} | |
try: | |
code = (await bot.http.request(r, json=payload))['code'] | |
except discord.Forbidden: | |
return await ctx.send('I Need the `Create Invite` permission.') | |
await ctx.send(embed=discord.Embed(description=f'[Click here!](https://discord.gg/{code})', color=0x2F3136)) | |
@bot.command('betrayal') | |
async def betrayal(ctx): | |
voice = ctx.author.voice | |
if not voice: | |
return await ctx.send('You have to be in a voice channel to use this command.') | |
r = Route('POST', '/channels/{channel_id}/invites', channel_id=voice.channel.id) | |
payload = { | |
'max_age': 0, | |
'target_type': 2, | |
'target_application_id': 773336526917861400 | |
} | |
try: | |
code = (await bot.http.request(r, json=payload))['code'] | |
except discord.Forbidden: | |
return await ctx.send('I Need the `Create Invite` permission.') | |
await ctx.send(embed=discord.Embed(description=f'[Click here!](https://discord.gg/{code})', color=0x2F3136)) | |
@bot.command('fishington') | |
async def fishington(ctx): | |
voice = ctx.author.voice | |
if not voice: | |
return await ctx.send('You have to be in a voice channel to use this command.') | |
r = Route('POST', '/channels/{channel_id}/invites', channel_id=voice.channel.id) | |
payload = { | |
'max_age': 0, | |
'target_type': 2, | |
'target_application_id': 814288819477020702 | |
} | |
try: | |
code = (await bot.http.request(r, json=payload))['code'] | |
except discord.Forbidden: | |
return await ctx.send('I Need the `Create Invite` permission.') | |
await ctx.send(embed=discord.Embed(description=f'[Click here!](https://discord.gg/{code})', color=0x2F3136)) | |
bot.run('TOKEN') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
사용시 출처