added activity check
This commit is contained in:
@@ -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
|
||||
|
||||
9
test.py
9
test.py
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user