mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
Update code.py
This commit is contained in:
@@ -435,6 +435,7 @@ async def transcript(ctx, channel: discord.TextChannel = None):
|
|||||||
messages.reverse()
|
messages.reverse()
|
||||||
transcript = ""
|
transcript = ""
|
||||||
#defer the response
|
#defer the response
|
||||||
|
await ctx.defer() #defer the response so that the bot doesn't say that it's thinking
|
||||||
for msg in messages:
|
for msg in messages:
|
||||||
if msg.author.bot:
|
if msg.author.bot:
|
||||||
transcript += f"Botator: {msg.content}\n"
|
transcript += f"Botator: {msg.content}\n"
|
||||||
@@ -464,6 +465,7 @@ async def transcript(ctx, channel: discord.TextChannel = None):
|
|||||||
await ctx.author.send(file=discord.File("transcript.txt"))
|
await ctx.author.send(file=discord.File("transcript.txt"))
|
||||||
#delete the file
|
#delete the file
|
||||||
os.remove("transcript.txt")
|
os.remove("transcript.txt")
|
||||||
|
return await ctx.channel.purge()
|
||||||
#these are debug commands and should not be used in production
|
#these are debug commands and should not be used in production
|
||||||
@bot.command(name="say", description="Say a message")
|
@bot.command(name="say", description="Say a message")
|
||||||
async def say(ctx, message: str):
|
async def say(ctx, message: str):
|
||||||
|
|||||||
Reference in New Issue
Block a user