Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 我在特定频道的工作脚本有问题_Python_Python 3.x_Discord_Discord.py_Discord.py Rewrite - Fatal编程技术网

Python 我在特定频道的工作脚本有问题

Python 我在特定频道的工作脚本有问题,python,python-3.x,discord,discord.py,discord.py-rewrite,Python,Python 3.x,Discord,Discord.py,Discord.py Rewrite,这是我认为我的最后一个问题,因为我不知道如何使我的脚本只在特定的频道工作这是我尝试的: ch = client.get_channel('my number channel id') if message.channel is not ch: return 下面是错误: 文件“”,第101行 如果message.channel不是ch: ^ 缩进错误:unindent不匹配任何外部缩进级别您有缩进问题(在python中,缩进是定义函数或类范围的方式)。试试这个: ch =

这是我认为我的最后一个问题,因为我不知道如何使我的脚本只在特定的频道工作这是我尝试的:


ch = client.get_channel('my number channel id')


   if message.channel is not ch:
    return
下面是错误:

文件“”,第101行
如果message.channel不是ch:
^
缩进错误:unindent不匹配任何外部缩进级别

您有缩进问题(在python中,缩进是定义函数或类范围的方式)。试试这个:

ch = client.get_channel('my number channel id')
if message.channel is not ch:
    return