Fully implemented /tcard command.

Bug fixes for member signup
Added live update of game header message during pitches
Documentation updates
This commit is contained in:
2021-08-05 02:00:03 +01:00
parent 175a911ed4
commit 94ce0aa31a
6 changed files with 62 additions and 33 deletions

View File

@ -148,7 +148,7 @@ class PlayerCommands(commands.Cog, name='Player Commands'):
tc = discord.utils.find(lambda x: x.id == lookup[guildStr][rStr]['text_channel'],ctx.guild.channels)
if tc is not None:
p = await tc.pins()
if p:
if p is not None:
header = discord.utils.find(lambda x: x.id == hm, p)
if header is not None:
text = header.content.split('\n')
@ -211,7 +211,7 @@ class PlayerCommands(commands.Cog, name='Player Commands'):
tc = discord.utils.find(lambda x: x.id == lookup[guildStr][rStr]['text_channel'],ctx.guild.channels)
if tc is not None:
p = await tc.pins()
if p:
if p is not None:
header = discord.utils.find(lambda x: x.id == hm, p)
if header is not None:
text = header.content.split('\n')

View File

@ -37,7 +37,6 @@ class TCardCommand(commands.Cog, name='T-Card Command'):
gms = yaml_load(gmFile)
categories = yaml_load(categoriesFile)
guildStr = str(ctx.guild.id)
# rStr = str(game.id)
embed = discord.Embed(
title='T-Card',
description='A T-Card Has Been Played',
@ -69,12 +68,9 @@ class TCardCommand(commands.Cog, name='T-Card Command'):
"""Do the audio thing."""
opus = discord.opus.load_opus('/usr/lib/x86_64-linux-gnu/libopus.so.0')
# discord.opus.load_opus()
# if not discord.opus.is_loaded():
# raise RuntimeError('Opus failed to load')
for vc in ctx.channel.category.voice_channels:
v = await vc.connect()
tcardaudio = discord.FFmpegPCMAudio(open("./assets/tcard.wav", "rb"))
tcardaudio = discord.PCMAudio(open("./assets/tcard.wav", "rb"))
v.play(tcardaudio)
while v.is_playing(): time.sleep(.1)
await v.disconnect()