Riju
Riju

Reputation: 77

How can I make my bot say full sentences that I say?

This is the code I am using currently:

@client.command()
async def say(ctx, arg: str):
    await ctx.channel.purge(limit=1)
    await ctx.send(f"{arg}")

This code works, but the bot only says the first word of the sentence. How can I make it say the whole sentence?

Upvotes: 0

Views: 212

Answers (1)

rambi
rambi

Reputation: 1259

I hope this would work:

@client.command()
async def say(ctx, *args):
    await ctx.message.delete()

    # do you want to say it with TTS ?
    await ctx.send(' '.join(args), tts=True)  

Upvotes: 1

Related Questions