如何修复 C# 中的 "represents text as a series of Unicode characters" 错误?

How to fix "represents text as a series of Unicode characters" error in C#?

我不想为我的 Discord 机器人创建一个功能,即每次我执行“|meme”命令时,机器人都会从包含图片的文件夹中发送一个 meme,但会提示错误:将文本表示为一系列Unicode 字符数。

   string[] dankMemes;

    public MyBot()
    {
        dankMemes = new string[]
        {
            "dm/1.jpeg";
            "dm/2.jpg";
            "dm/3.jpg";
            "dm/4.jpg";
        };

试试这个:

    string[] dankMemes;

    public MyBot()
    {
        dankMemes = new string[]
        {
            "dm/1.jpeg",
            "dm/2.jpg",
            "dm/3.jpg",
            "dm/4.jpg"
        };
    }