@bot.command(name = 'create')
async def create(ctx, args):
url = 'https://w2g.tv/rooms/create.json'
wkey = 'btwzkumhxj33aq0iyp9891fv2v6v4o2l86y2wbn8kyzc3oehmwrxqb9x4d8g6iv9'
bg = '#FF0000'
opacity = 50
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
data= {
'w2g_api_key' : 'adfdfd',
'bg_color' : 'hfhjfh',
'share' : args ,
'bg_opacity' : 'dsdsds'
}
data['w2g_api_key'] = wkey
data['bg_color'] = bg
data['share'] = args
data['bg_opacity'] = opacity
data = requests.post( url , headers , data).json()
print(data)
streamkey = data['streamkey']
keyem = discord.Embed(
title = 'Here is your stream link!',
color = 16776960,
url = 'https://w2g.tv/rooms/' + streamkey
)
#keyem.add_field(
#name = 'Or if you just want the strem key!',
#value = streamkey
# )
await ctx.send(embed = keyem)
this is my current code but when i join the room its playing something verry diffrent i must be doing something wrong
Please have a look at the API docs at Watch2Gether API Documentation Make sure your body is really in JSON format.
this should work im working in python
it does work the only thing that isnt is that the wrong video is show its always the bunny one
my body is in JSON Format
its all working EXEPT ! it wont show the youtube video in the room it keeps showing the bunny or the lama video
PLEASE HELP !!!
@commands.command(name=‘create’)
async def create(self, ctx, args):
url = 'https://w2g.tv/rooms/create.json'
wkey = '3ovwq9n0erywpheppfr7ylutwtdm698p2e5nx1fso9kc2ztew948y02c6t2zu2dn'
bg = '#FF0000'
opacity = 50
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
data= {
'w2g_api_key' : '3ovwq9n0erywpheppfr7ylutwtdm698p2e5nx1fso9kc2ztew948y02c6t2zu2dn',
'bg_color' : 'hfhjfh',
'share' : "https://www.youtube.com/watch?v=HJvWo8xtwjE" ,
'bg_opacity' : 'dsdsds'
}
data['w2g_api_key'] = wkey
data['bg_color'] = bg
data['share'] = args
data['bg_opacity'] = opacity
data = requests.post( url , headers , data).json()
streamkey = data['streamkey']
keyem = discord.Embed(
title = 'Here is your stream link!',
color = 16776960,
url = 'https://w2g.tv/rooms/' + streamkey
)
#keyem.add_field(
#name = 'Or if you just want the strem key!',
#value = streamkey
# )
print(url)
print(headers)
print(data)
await ctx.send(embed=keyem)