added activity check

This commit is contained in:
2022-08-25 08:30:26 +03:00
parent a6eaec4190
commit a603898f2d
2 changed files with 39 additions and 32 deletions

View File

@@ -19,6 +19,9 @@ class Audio(commands.Cog):
@commands.Cog.listener()
async def on_voice_state_update(self, member, before, after):
if any('Escape from Tarkov' in str(user.activity) for user in after.channel.members):
logging.info('Skip playing by Game')
else:
from lib.Comands import read_json
_role = await read_json(member.guild.id, 'tigger_role')
# Read audio from DB
@@ -49,6 +52,7 @@ class Audio(commands.Cog):
else:
logging.info(f'Skip playing')
@commands.command(name="upload_audio")
async def upload_audio(self, ctx, user=None):
user = user or ctx.author

View File

@@ -17,10 +17,13 @@ intents = disnake.Intents(messages=True,
guilds=True,
message_content=True,
voice_states=True,
members=True)
members=True,
presences=True
)
bot = commands.Bot(command_prefix=determine_prefix,
intents=intents
intents=intents,
reload=True
)
logging.basicConfig(stream=sys.stdout, filemode='w', level='INFO',
@@ -73,4 +76,4 @@ async def slash_cogs(inter, what_do):
await inter.response.send_message('You`re not bot owner', ephemeral=True)
bot.run('OTQ3OTUzOTAxNzgzNjIxNjYy.GTXbMv.KrztaTO7-ivsPEAVjsyikSQ-GP-ANwULmDraig')
bot.run('OTQ2ODE5MDA0MzE0NTcwODUy.YhkP6Q.dhFqi2MJMrxzHt5FtjK5Cl-5BI8')