initial commit
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
commit
c22dade3d5
21 files changed
+564
No files matched your search
+21
@@ -0,0 +1,21 @@
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from core.text import split
|
||||
NOTE="-# slow down, this rep was rate limited, if you still spam the rate limite will increase"
|
||||
class Ctx(commands.Context):
|
||||
limited=False
|
||||
async def send(s,content=None,**kw):
|
||||
kw.setdefault("mention_author",False)
|
||||
text=None if content is None else str(content)
|
||||
if s.limited:
|
||||
text=f"{text}\n{NOTE}" if text else NOTE
|
||||
parts=split(text,1900) if len(text)>2000 else [text]
|
||||
else:parts=split(text) if text is not None and len(text)>2000 else [text]
|
||||
m=None
|
||||
for i,p in enumerate(parts):
|
||||
k=kw if i==len(parts)-1 else {"mention_author":False}
|
||||
try:m=await s.message.reply(p,**k)
|
||||
except discord.HTTPException:
|
||||
k.pop("mention_author",None);m=await s.channel.send(p,**k)
|
||||
return m
|
||||
reply=send
|
||||
Reference in new issue
Block a user