Skip to content

Instantly share code, notes, and snippets.

@minibox24
Created April 10, 2021 14:04
Show Gist options
  • Save minibox24/0025c09ca3941fca541e31429f5bd019 to your computer and use it in GitHub Desktop.
Save minibox24/0025c09ca3941fca541e31429f5bd019 to your computer and use it in GitHub Desktop.
discord.py activities invite generator
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')
@minibox24
Copy link
Author

사용시 출처

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment