【发布时间】:2021-04-03 07:13:04
【问题描述】:
Private Async Function cmdList() As Task Dim m = Context.Message Dim u = Context.User Dim g = Context.Guild Dim c = Context.Client Dim words As String = "" Dim embed As New EmbedBuilder With { .Title = $"Wallpaper keyword list", .ImageUrl = "https://i.imgur.com/vc241Ku.jpeg", .Description = "The full list of keywords in our random wallpaper list", .Color = New Color(masterClass.randomEmbedColor), .ThumbnailUrl = g.IconUrl, .Timestamp = Context.Message.Timestamp, .Footer = New EmbedFooterBuilder With { .Text = "Keyword Data", .IconUrl = g.IconUrl } } For Each keyword As String In wall.keywords words = words + keyword + " **|** " Next embed.AddField("Full list", words) Await m.Channel.SendMessageAsync("", False, embed.Build()) End Function
这是我从数组中获取每个单词并将其放在字段中的命令。我想知道的是如何制作它,以便一旦字段填满,它将自动添加一个新字段并继续列表。这可能有点牵强,但只是不知道如何去做。对不起,如果我不能理解任何答案。我对 Discord.net 和 vb 上的编码还是有点陌生。
【问题讨论】:
-
在构建你的words字符串时,检查要添加的新词的长度是否会导致字符串超过字段的最大长度。如果超过,不要将其添加到字符串中,而是将字符串添加到字段中...使用新单词重置
words继续相同的逻辑,直到完成。 -
这会很有趣。不知道该怎么做。
-
hastebin.com/ixaqubelat.php 来自我的尝试。不知道我到底需要做什么。
标签: vb.net discord discord.net