小编slo*_*ng9的帖子

不正确的令牌传递

我正在 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)

python token discord discord.py

5
推荐指数
3
解决办法
1万
查看次数

python中的布尔递归

我试图看看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)

python recursion boolean

2
推荐指数
1
解决办法
420
查看次数

标签 统计

python ×2

boolean ×1

discord ×1

discord.py ×1

recursion ×1

token ×1