我目前正在开发与表情符号配合使用的Discord机器人。但是以某种方式,我不能让我的机器人写两个以上的表情符号。
这有效:
case 'test':
embed = new Discord.MessageEmbed()
.setColor(hexColor)
.setDescription(`Two Emoji <:harold:620608308910358530> <a:nice:634785041762877441> ok.`)
message.channel.send(embed);
break;
表情符号照常显示在不和谐聊天中。
但是,如果我用更多的表情符号来做到这一点,例如:
case 'test':
embed = new Discord.MessageEmbed()
.setColor(hexColor)
.setDescription(`Three Emoji <:harold:620608308910358530> <:harold:620608308910358530> <a:nice:634785041762877441> ok.`)
message.channel.send(embed);
break;
Discord自动将漫游器的消息转换为此:
Three Emoji :harold: :harold: :nice: ok.
因此不再显示实际的表情符号,而是显示其名称周围带有:
的表情。
这可以防止我在一条消息中包含两个以上的自定义表情符号。有办法防止这种情况发生吗?还是这只是Discord方面的已知限制?
答案 0 :(得分:1)
使用自定义表情符号时,最好先获取自定义表情符号,然后再使用它。
fig = plt.figure(facecolor='#131722',dpi=155, figsize=(10, 3))
ax1 = plt.subplot2grid((3,3), (2,0), facecolor='#131722')
ax2 = plt.subplot2grid((5,3), (2,2), colspan=5, rowspan=4, facecolor='#131722')
Colors = [['#0400ff', '#FF0000'], ['#09ff00', '#ff8c00']]
for x in List:
Index = List.index(x)
rate_buy = []
total_buy = []
rate_sell = []
total_sell = []
for y in x['data']['asks']:
rate_sell.append(y[0])
total_sell.append(y[1])
for y in x['data']['bids']:
rate_buy.append(y[0])
total_buy.append(y[1])
rBuys = pd.DataFrame({'buy': rate_buy})
rSells = pd.DataFrame({'sell': rate_sell})
tBuys = pd.DataFrame({'total': total_buy})
tSells = pd.DataFrame({'total': total_sell})
ax1.plot(rBuys.buy, tBuys.total, color=Colors[Index][0], linewidth=0.5, alpha=1, label='test')
ax2.plot(rSells.sell, tSells.total, color=Colors[Index][1],alpha=0.5, linewidth=1, label=x['exchange'])
ax1.fill_between(rBuys.buy, 0, tBuys.total, facecolor=Colors[Index][0], alpha=0.4)
ax2.fill_between(rSells.sell, 0, tSells.total, facecolor=Colors[Index][1], alpha=0.4)