小编Has*_*_BH的帖子

如何修复错误:字体配置错误:无法加载默认配置文件

client.on('guildMemberAdd', async (member) => {
 const channel = member.guild.channels.cache.find(
  (channel) => channel.name === 'general'
 );

 if (!channel) return;

 const canvas = Canvas.createCanvas(700, 250);

 const ctx = canvas.getContext('2d');

 const background = await Canvas.loadImage('./wallpaper.jpg');
 ctx.drawImage(background, 0, 0, canvas.width, canvas.height);

 ctx.strokeStyle = '#ffffff';
 ctx.strokeRect(0, 0, canvas.width, canvas.height);

 // Select the font size and type from one of the natively available fonts
 ctx.font = '60px ArialCE.ttf';
 // Select the style that will be used to fill the text in
 ctx.fillStyle = '#ffffff';
 // Actually …
Run Code Online (Sandbox Code Playgroud)

javascript node.js discord.js

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

discord.js ×1

javascript ×1

node.js ×1