Untitled

mail@pastecode.io avatar
unknown
python
a month ago
2.8 kB
3
Indexable
Never
@tree.command(guild=discord.Object(id=id_servidor),name='report',description='Bugs panel.') 
async def _report(interaction:discord.Interaction, bugname:str , device:str, frequency:str, description:str, proof:discord.Attachment):
    if any(role.id == id_cargo_suporte for role in interaction.user.roles):

        debate = interaction.guild.get_channel(id_bugs)

        embed = discord.Embed(
            color=26367
        )
        embed.add_field(name='Submitter', value=f'{interaction.user.mention}', inline=False)
        embed.add_field(name='Bug name', value=f'{bugname}', inline=False)
        embed.add_field(name='Device', value=f'{device}', inline=False)
        embed.add_field(name='Frequency', value=f'{frequency}', inline=False)
        embed.add_field(name='Description', value=f'{description}', inline=False)
        embed.set_image(url=f'{proof}')
        embed.set_thumbnail(url=interaction.user.avatar)

        embedok = discord.Embed(
             colour=26367,
             description='Thank you for report, we really appreciate your cooperation with the game.'
        )
        await interaction.response.send_message(embed=embedok, ephemeral=True)
        topic = await debate.send(embed=embed)
        await topic.create_thread(name='Discuss Bug')
    else:
        await interaction.response.send_message('You dont have permissions',ephemeral=True)



@tree.command(guild=discord.Object(id=id_servidor),name='testingbug',description='Testing Bugs.') 
async def _testingbug(interaction:discord.Interaction, bugname:str , device:str, frequency:str, description:str, proof:discord.Attachment):
    if any(role.id == id_cargo_suporte for role in interaction.user.roles):

        debate = interaction.guild.get_channel(id_bugs)

        embed = discord.Embed(
            color=26367
        )
        embed.add_field(name='Submitter', value=f'{interaction.user.mention}', inline=False)
        embed.add_field(name='Bug name', value=f'{bugname}', inline=False)
        embed.add_field(name='Device', value=f'{device}', inline=False)
        embed.add_field(name='Frequency', value=f'{frequency}', inline=False)
        embed.add_field(name='Description', value=f'{description}', inline=False)
        embed.set_image(url=f'{proof}')
        embed.set_thumbnail(url=interaction.user.avatar)

        embedok = discord.Embed(
             colour=26367,
             description='Thank you for report, we really appreciate your cooperation with the game.'
        )
        await interaction.response.send_message(embed=embedok, ephemeral=True)
        topic = await debate.send(embed=embed)
        await topic.create_thread(name='Discuss Bug')
    else:
        await interaction.response.send_message('You dont have permissions',ephemeral=True)
Leave a Comment