@@ -1046,6 +1046,61 @@ async def send(
1046
1046
1047
1047
return self .message
1048
1048
1049
+ async def channel_send (
1050
+ self ,
1051
+ channel : discord .abc .Messageable ,
1052
+ allowed_mentions : discord .AllowedMentions | None = None ,
1053
+ delete_after : float | None = None ,
1054
+ ) -> discord .Message :
1055
+ """Sends a message to a specified channel with the paginated items.
1056
+
1057
+ Parameters
1058
+ ----------
1059
+ channel: Optional[:class:`~discord.abc.Messageable`]
1060
+ A channel where the paginated message should be sent.
1061
+ allowed_mentions: Optional[:class:`~discord.AllowedMentions`]
1062
+ Controls the mentions being processed in this message. If this is
1063
+ passed, then the object is merged with :attr:`~discord.Client.allowed_mentions`.
1064
+ The merging behaviour only overrides attributes that have been explicitly passed
1065
+ to the object, otherwise it uses the attributes set in :attr:`~discord.Client.allowed_mentions`.
1066
+ If no object is passed at all then the defaults given by :attr:`~discord.Client.allowed_mentions`
1067
+ are used instead.
1068
+ delete_after: Optional[:class:`float`]
1069
+ If set, deletes the paginator after the specified time.
1070
+
1071
+ Returns
1072
+ -------
1073
+ :class:`~discord.Message`
1074
+ The message that was sent with the paginator.
1075
+ """
1076
+ if not isinstance (channel , discord .abc .Messageable ):
1077
+ raise TypeError (f"expected abc.Messageable not { channel .__class__ !r} " )
1078
+
1079
+ if allowed_mentions is not None and not isinstance (
1080
+ allowed_mentions , discord .AllowedMentions
1081
+ ):
1082
+ raise TypeError (
1083
+ f"expected AllowedMentions not { allowed_mentions .__class__ !r} "
1084
+ )
1085
+
1086
+ self .update_buttons ()
1087
+ page = self .pages [self .current_page ]
1088
+ page_content = self .get_page_content (page )
1089
+
1090
+ if page_content .custom_view :
1091
+ self .update_custom_view (page_content .custom_view )
1092
+
1093
+ self .message = await channel .send (
1094
+ content = page_content .content ,
1095
+ embeds = page_content .embeds ,
1096
+ files = page_content .files ,
1097
+ view = self ,
1098
+ allowed_mentions = allowed_mentions ,
1099
+ delete_after = delete_after ,
1100
+ )
1101
+
1102
+ return self .message
1103
+
1049
1104
async def edit (
1050
1105
self ,
1051
1106
message : discord .Message ,
0 commit comments