@@ -96,19 +96,6 @@ def _smart_guess_lib(self, ctx: core.Context) -> LibEnum | None:
96
96
97
97
return None
98
98
99
- async def context_reply (
100
- self ,
101
- ctx : core .Context ,
102
- content : str | None = discord .utils .MISSING ,
103
- embed : discord .Embed | None = discord .utils .MISSING ,
104
- reference : discord .MessageReference | None = None ,
105
- mention_author : bool = True ,
106
- ) -> discord .Message :
107
- if ctx .message .reference and not reference :
108
- reference = ctx .message .reference
109
-
110
- return await ctx .send (content = content , embed = embed , reference = reference , mention_author = mention_author )
111
-
112
99
@commands .command (
113
100
"rtfm" ,
114
101
brief = "Searches documentation" ,
@@ -141,7 +128,7 @@ async def rtfm(self, ctx: core.Context, *, query: str) -> None:
141
128
await ctx .reply ("Sorry, I couldn't apply a default library to this channel. Try again with a library?" )
142
129
return
143
130
144
- await self . context_reply ( ctx , str (lib .value ))
131
+ await ctx . reply ( str (lib .value ), reference = ctx . replied_message )
145
132
return
146
133
147
134
labels = False
@@ -174,7 +161,7 @@ async def rtfm(self, ctx: core.Context, *, query: str) -> None:
174
161
return
175
162
176
163
if not final_query :
177
- await self . context_reply ( ctx , str (lib .value [0 ]))
164
+ await ctx . reply ( str (lib .value [0 ]), reference = ctx . replied_message )
178
165
return
179
166
180
167
url = self .target .with_path ("/api/public/rtfm.sphinx" ).with_query (
@@ -239,7 +226,7 @@ async def rtfs(self, ctx: core.Context, *, query: str) -> None:
239
226
await ctx .reply ("Sorry, I couldn't apply a default library to this channel. Try again with a library?" )
240
227
return
241
228
242
- await self . context_reply ( ctx , str (lib .value ))
229
+ await ctx . reply ( str (lib .value ), reference = ctx . replied_message )
243
230
return
244
231
245
232
source = False
@@ -310,9 +297,7 @@ async def rtfs(self, ctx: core.Context, *, query: str) -> None:
310
297
311
298
else :
312
299
n = next (iter (nodes .items ()))
313
- await self .context_reply (
314
- ctx , f"Showing source for `{ n [0 ]} `\n Commit: { matches ['commit' ][:6 ]} " , mention_author = False
315
- )
300
+ await ctx .reply (f"Showing source for `{ n [0 ]} `\n Commit: { matches ['commit' ][:6 ]} " , reference = ctx .replied_message )
316
301
317
302
pages = TextPager (ctx , n [1 ], prefix = "```py" )
318
303
await pages .paginate ()
0 commit comments