【发布时间】:2021-04-30 17:43:17
【问题描述】:
我需要票务方面的帮助。当有人想寻求帮助时,一切都很好,创建一个频道和一条消息,但没有将命令的作者添加到票务频道,甚至看不到他。我希望你能帮助我!
@client.command()
async def support(ctx, *, reason = None):
guildid = ctx.guild.id
guild = ctx.guild
user = ctx.author
amount2 = 1
await ctx.channel.purge(limit=amount2)
channel = await guild.create_text_channel(f'Ticket {user}')
await channel.set_permissions(ctx.guild.default_role, send_messages=False, read_messages=False)
perms = channel.overwrites_for(user)
await channel.set_permissions(user, view_channel=not perms.view_channel)
await channel.set_permissions(user, read_message_history=not perms.read_message_history)
await channel.set_permissions(user, send_messages=not perms.send_messages)
await channel.send(f"{user.mention}")
supem = discord.Embed(title=f"{user} Poprosił o pomoc.", description= "", color=0x00ff00)
supem.add_field(name="Powód", value=f"``{reason}``")
supem.set_footer(text=f"Wkrótce przyjdzie do ciebie administrator ")
await channel.send(embed=supem)
【问题讨论】:
标签: python discord discord.py bots