Fix bug in view command
This commit is contained in:
parent
1aeb690dc8
commit
876bd54687
@ -236,22 +236,18 @@ class Tickets(commands.Cog):
|
|||||||
requestor = ctx.guild.get_member(int(request['author']))
|
requestor = ctx.guild.get_member(int(request['author']))
|
||||||
if requestor == ctx.author or admin:
|
if requestor == ctx.author or admin:
|
||||||
pag = Paginator(self.bot, prefix='```md', suffix='```')
|
pag = Paginator(self.bot, prefix='```md', suffix='```')
|
||||||
header = f''
|
header = (f'Request {id} by {requestor.mention if requestor else "`User cannot be found`"}:\n'
|
||||||
if request_resp.status == 200:
|
f'```{request["content"]}```')
|
||||||
request = await request_resp.json()
|
pag.set_header(header)
|
||||||
requestor = ctx.guild.get_member(int(request["author"]))
|
|
||||||
header += (f'Request {id} by {requestor.mention if requestor else "`User cannot be found`"}:\n'
|
|
||||||
f'```{request["content"]}```')
|
|
||||||
pag.set_header(header)
|
|
||||||
|
|
||||||
if request.get('comments'):
|
if request.get('comments'):
|
||||||
comments = request['comments']
|
pag.add('Comments: \n')
|
||||||
for comment in comments:
|
comments = request['comments']
|
||||||
author = ctx.guild.get_member(int(comment['author']))
|
for comment in comments:
|
||||||
pag.add(f'{author.display_name}: {comment["content"]}', keep_intact=True)
|
author = ctx.guild.get_member(int(comment['author']))
|
||||||
if ctx.author != requestor and requestor:
|
pag.add(f'{author.display_name}: {comment["content"]}', keep_intact=True)
|
||||||
for page in pag.pages(page_headers=False):
|
else:
|
||||||
await requestor.send(page)
|
pag.add('No Comments')
|
||||||
book = Book(pag, (None, ctx.channel, self.bot, ctx.message))
|
book = Book(pag, (None, ctx.channel, self.bot, ctx.message))
|
||||||
await book.create_book()
|
await book.create_book()
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user