我正在 youtube 上关注 python discord bot 的基本教程,我的代码在下面。它说一个不正确的令牌已被传递。在有人问之前,是的,我已经输入了机器人令牌而不是 ID 或秘密
import discord
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
import time
Client = discord.Client()
client = commands.Bot(command_prefix = "!")
@client.event
async def on_ready():
print("Bot is ready!")
@client.event
async def on_message(message):
if message.content == "cookie":
await client.send_message(message.channel, ":cookie:")
client.run("token is here")
Run Code Online (Sandbox Code Playgroud) 我试图看看a是否是b的力量.为了实现这一点,需要被b整除,而a/b也需要是b的幂.我正在努力应对这里的递归,因为它似乎将永远持续下去.有人可以帮忙吗?
def is_power(a,b):
if(a % b == 0):
a = a/b
if(is_power(a,b)):
return True
return False
Run Code Online (Sandbox Code Playgroud)