Discord.js Message.channel.send将文本发送为代码,并将整数转换为字符串。

huangapple go评论54阅读模式
英文:

Discord.js Message.channel.send sends the text as a code with and converts int to strings

问题

I'm trying to send a message in discord.js by my bot, I tried to use message.channel.send but it says that the max length is 2000 so I've split the message but there's a worse bug happens
the message shows as code, all numbers in it converted to strings
here how it prints

all numbers are converted to strings

I tried to split the message but it didn't work
here's the code:

if (message.content === "rules") {
   message.channel.send (`**Hello Everyone,
Welcome to Eagle Company, Where you can find all your needs in the freelancing work stage
With our Highly Experienced Sellers, Boosters, and Programmers...
But what are our services ?
1. We provide Programmers for all programming roads.
2. Photo Designers and Graphic Designers.
3. Game boosting and leveling (Smurf accounts). you can check #prices for more details.
4. Marketing for drop shippers and starting websites, stores , etc.
5. Providing projects for freelancers (with a fee).
6. Jobs
===========================================================================================================
First of all, We have some rules that you must follow:
1. We must respect each other.
2. No spamming.
3. Use appropriate language and content.
4. No personal attacks or doxing.
5. Follow Discord's terms of service.
6. Respect server staff and don't mention them for no reason.
7. No unauthorized advertising.
8. NSFW stuff is forbidden and leads to an instant ban.
9. No discord invites.
10. No trolls in Jobs Applications
===========================================================================================================
And now about the store rules:
1. Make sure to check with a broker from the server before making a purchase (for free).
2. Most of the time, our services are provided by freelancers, so if you have problems with them in deals or prices make sure to contact any staff member to solve the sort out
3. You can buy or ask for a service on Discord server by creating a ticket or use our Trusted Selling pages on websites like g2g...Type m.links for websites URLs.
4. Try to be sure before confirming any service in our store, Because we don't do refunds.
============================================================================================================
That was the global rules of the server.
You can find all rules for each server on its own channel.
and if you need any help, Make a ticket and we will help as fast as possible.

Have fun Everyone.**`)
};
英文:

I'm trying to send a message in discord.js by my bot, I tried to use message.channel.send but it says that the max lengh is 2000 so I've split the message but there's a worse bug happens
the message shows as code, all numbers in it converted to strings
here how it prints

all numbers are converted to strings

I tried to split the message but it didn't work
here's the code:

if (message.content === "rules") {
   message.channel.send (`**Hello Everyone,
Welcome to Eagle Company, Where you can find all your needs in the freelancing work stage
With our Highly Experienced Sellers, Boosters, and Programmers...
But what are our services ?
1. We provide Programmers for all programming roads.
2. Photo Designers and Graphic Designers.
3. Game boosting and leveling (Smurf accounts). you can check #prices for more details.
4. Marketing for drop shippers and starting websites, stores , etc.
5. Providing projects for freelancers (with a fee).
6. Jobs
===========================================================================================================
First of all, We have some rules that you must follow:
1. We must respect each other.
2. No spamming.
3. Use appropriate language and content.
4. No personal attacks or doxing.
5. Follow Discord's terms of service.
6. Respect server staff and don't mention them for no reason.
7. No unauthorized advertising.
8. NSFW stuff is forbidden and leads to an instant ban.
9. No discord invites.
10. No trolls in Jobs Applications
===========================================================================================================
And now about the store rules:
1. Make sure to check with a broker from the server before making a purchase (for free).
2. Most of the time, our services are provided by freelancers, so if you have problems with them in deals or prices make sure to contact any staff member to solve the sort out
3. You can buy or ask for a service on Discord server by creating a ticket or use our Trusted Selling pages on websites like g2g...Type m.links for websites URLs.
4. Try to be sure before confirming any service in our store, Because we don't do refunds.
============================================================================================================
That was the global rules of the server.
You can find all rules for each server on it's own channel.
and if you need any help, Make a ticket and we will help as fast as possible.

Have fun Everyone.**`)

};

答案1

得分: 1

这是Discord的新格式,通过在某些数字前添加空格,您会无意中格式化它,例如像这样的文本:

Discord.js Message.channel.send将文本发送为代码,并将整数转换为字符串。

会变成这样:

Discord.js Message.channel.send将文本发送为代码,并将整数转换为字符串。

您可以通过使用\来转义Markdown,或者用\n替换新行来解决这个问题。

英文:

That is Discords new formatting by adding spaces before some of your numbers you are unintentionally formatting it, for example text like this:

Discord.js Message.channel.send将文本发送为代码,并将整数转换为字符串。

would turn into this:

Discord.js Message.channel.send将文本发送为代码,并将整数转换为字符串。

A way you could counter this is by escaping the markdown by using \ or you could substitute the new lines with \n

huangapple
  • 本文由 发表于 2023年6月12日 11:44:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76453533.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定