AttributeError: 'Bot' object has no attribute 'pin_message'
AttributeError: 'Bot' object has no attribute 'pin_message'
错误:AttributeError:'Bot'对象没有属性'pin_message'
它正在做这个错误,我不明白为什么。
谁能帮我这个
感恩
global stopcheck
stopcheck = 'test'
import asyncio
global time
time = 100
import os
ContinueAutoJoke = 'autojoke'
StopAutoJoke = 'o'
import discord
import time
import random
import discord
from discord.ext import commands
client = discord.Client()
client = commands.Bot(command_prefix = '$')
@client.command()
async def test(ctx):
message = await ctx.send(f'All messages gonna be deleted in 100 seconds')
await client.pin_message(message)
for c in range(-100,0):
await message.edit(content=f'All messages gonna be deleted in {c} seconds')
您需要使用 discord.Message.pin()
,而不是 client.pin_message(message)
:
@client.command()
async def test(ctx):
message = await ctx.send(f'All messages gonna be deleted in 100 seconds')
await message.pin()
for c in range(-100,0):
await message.edit(content=f'All messages gonna be deleted in {c} seconds')
asyncio.sleep(1)
await ctx.purge(limit=100)
错误:AttributeError:'Bot'对象没有属性'pin_message' 它正在做这个错误,我不明白为什么。 谁能帮我这个 感恩
global stopcheck
stopcheck = 'test'
import asyncio
global time
time = 100
import os
ContinueAutoJoke = 'autojoke'
StopAutoJoke = 'o'
import discord
import time
import random
import discord
from discord.ext import commands
client = discord.Client()
client = commands.Bot(command_prefix = '$')
@client.command()
async def test(ctx):
message = await ctx.send(f'All messages gonna be deleted in 100 seconds')
await client.pin_message(message)
for c in range(-100,0):
await message.edit(content=f'All messages gonna be deleted in {c} seconds')
您需要使用 discord.Message.pin()
,而不是 client.pin_message(message)
:
@client.command()
async def test(ctx):
message = await ctx.send(f'All messages gonna be deleted in 100 seconds')
await message.pin()
for c in range(-100,0):
await message.edit(content=f'All messages gonna be deleted in {c} seconds')
asyncio.sleep(1)
await ctx.purge(limit=100)