mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Check attach_files permission inside send_interactive (#6552)
Co-authored-by: Michael Oliveira <34169552+Flame442@users.noreply.github.com>
This commit is contained in:
parent
1daf56f3d8
commit
6603cd1a86
@ -2477,23 +2477,34 @@ class Red(
|
||||
msg = await channel.send(box(page, lang=box_lang))
|
||||
ret.append(msg)
|
||||
n_remaining = len(messages) - idx
|
||||
files_perm = (
|
||||
not channel.guild or channel.permissions_for(channel.guild.me).attach_files
|
||||
)
|
||||
options = ("more", "file") if files_perm else ("more",)
|
||||
if n_remaining > 0:
|
||||
if n_remaining == 1:
|
||||
prompt_text = _(
|
||||
"There is still one message remaining. Type {command_1} to continue"
|
||||
" or {command_2} to upload all contents as a file."
|
||||
)
|
||||
if files_perm:
|
||||
prompt_text = _(
|
||||
"There is still one message remaining. Type {command_1} to continue or {command_2} to upload all contents as a file."
|
||||
)
|
||||
else:
|
||||
prompt_text = _(
|
||||
"There is still one message remaining. Type {command_1} to continue."
|
||||
)
|
||||
else:
|
||||
prompt_text = _(
|
||||
"There are still {count} messages remaining. Type {command_1} to continue"
|
||||
" or {command_2} to upload all contents as a file."
|
||||
)
|
||||
if files_perm:
|
||||
prompt_text = _(
|
||||
"There are still {count} messages remaining. Type {command_1} to continue or {command_2} to upload all contents as a file."
|
||||
)
|
||||
else:
|
||||
prompt_text = _(
|
||||
"There are still {count} messages remaining. Type {command_1} to continue."
|
||||
)
|
||||
|
||||
query = await channel.send(
|
||||
prompt_text.format(count=n_remaining, command_1="`more`", command_2="`file`")
|
||||
)
|
||||
pred = MessagePredicate.lower_contained_in(
|
||||
("more", "file"), channel=channel, user=user
|
||||
)
|
||||
pred = MessagePredicate.lower_contained_in(options, channel=channel, user=user)
|
||||
try:
|
||||
resp = await self.wait_for(
|
||||
"message",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user