如何向服务器中的所有成员发送消息?

时间:2020-05-23 03:04:44

标签: javascript discord discord.js

Discord版本:12.2.0
我如何在所有私人聊天->(DM)中发送嵌入代码?

ValueError                                Traceback (most recent call last)
<ipython-input-95-2310a4d5ca2d> in <module>
      2 plt.figure(figsize=(20, 50))
      3 plt.title("Dendrograms")
----> 4 dend = shc.dendrogram(shc.linkage(df, method='ward'), leaf_font_size=12, orientation='right', labels='Country')

~\Anaconda3\lib\site-packages\scipy\cluster\hierarchy.py in linkage(y, method, metric, optimal_ordering)
   1040         raise ValueError("Invalid method: {0}".format(method))
   1041 
-> 1042     y = _convert_to_double(np.asarray(y, order='c'))
   1043 
   1044     if y.ndim == 1:

~\Anaconda3\lib\site-packages\scipy\cluster\hierarchy.py in _convert_to_double(X)
   1562 def _convert_to_double(X):
   1563     if X.dtype != np.double:
-> 1564         X = X.astype(np.double)
   1565     if not X.flags.contiguous:
   1566         X = X.copy()

ValueError: could not convert string to float: 'USA'

1 个答案:

答案 0 :(得分:1)

您可以通过循环成员并向他们发送消息来向行会中的所有成员发送消息。

const members = await message.guild.members.fetch()
members.forEach((member) => member.send(embed))