2017-11-15 41 views
-1

こんにちは私はボットが自分の仕事を終えたときにメッセージを削除しようとしていますが、どうしたらいいですか?手伝って頂けますか ? plsはこれが私のコードです:メッセージを削除するにはDiscord.py

@client.command(pass_context=True) 
async def chiant(ctx, *args): 

    phrase = "" 
    if args == None: 
     await client.say("Aie tu as oublié de mettre une phrase !") 
    elif len(args) != 0: 
     for e in args: 
      phrase = phrase +" "+ e 
     #await client.say(phrase) 
    else: 
     await client.say("Aie tu as oublié de mettre une phrase !") 

    await client.say(phrase, tts=True) 

    await client.delete_message(ctx.message) 
+0

を?あなたはエラーや奇妙な動作に遭遇していますか?もしそうなら、エラーメッセージ/動作の説明を私達に提供してください。 – sjaustirni

答えて

0

私はと私の問題解決:まさにそれがこれを実装するからあなたを停止されている何

@client.command(pass_context=True) 
async def chiant(ctx, *args): 

    phrase = "" 
    if args == None: 
     await client.say("Aie tu as oublié de mettre une phrase !") 
    elif len(args) != 0: 
     for e in args: 
      phrase = phrase +" "+ e 
     #await client.say(phrase) 
    else: 
     await client.say("Aie tu as oublié de mettre une phrase !") 

    message = await client.say(phrase, tts=True) #This line fix ALL ! 

    await client.delete_message(message) 
関連する問題