mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-05 18:58:53 -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))
|
msg = await channel.send(box(page, lang=box_lang))
|
||||||
ret.append(msg)
|
ret.append(msg)
|
||||||
n_remaining = len(messages) - idx
|
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 > 0:
|
||||||
if n_remaining == 1:
|
if n_remaining == 1:
|
||||||
prompt_text = _(
|
if files_perm:
|
||||||
"There is still one message remaining. Type {command_1} to continue"
|
prompt_text = _(
|
||||||
" or {command_2} to upload all contents as a file."
|
"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:
|
else:
|
||||||
prompt_text = _(
|
if files_perm:
|
||||||
"There are still {count} messages remaining. Type {command_1} to continue"
|
prompt_text = _(
|
||||||
" or {command_2} to upload all contents as a file."
|
"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(
|
query = await channel.send(
|
||||||
prompt_text.format(count=n_remaining, command_1="`more`", command_2="`file`")
|
prompt_text.format(count=n_remaining, command_1="`more`", command_2="`file`")
|
||||||
)
|
)
|
||||||
pred = MessagePredicate.lower_contained_in(
|
pred = MessagePredicate.lower_contained_in(options, channel=channel, user=user)
|
||||||
("more", "file"), channel=channel, user=user
|
|
||||||
)
|
|
||||||
try:
|
try:
|
||||||
resp = await self.wait_for(
|
resp = await self.wait_for(
|
||||||
"message",
|
"message",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user