mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-15 05:36:54 +00:00
Added the 'heal' command and potion functionionality. It doesn't work for the opponent for some reason
This commit is contained in:
@@ -41,11 +41,14 @@ async function welcome(member, welcomechannel, welcomemessage = null, welcomeban
|
||||
|
||||
// Declare a base size of the font
|
||||
let fontSize = 70;
|
||||
let i = 0;
|
||||
|
||||
do {
|
||||
// Assign the font to the context and decrement it so it can be measured again
|
||||
context.font = `italic ${fontSize -= 10}px sans-serif`;
|
||||
// Compare pixel width of the text to the canvas minus the approximate avatar size
|
||||
|
||||
i ++;
|
||||
} while (context.measureText(text).width > canvas.width - 100);
|
||||
|
||||
// Return the result to use in the actual canvas
|
||||
@@ -62,9 +65,9 @@ async function welcome(member, welcomechannel, welcomemessage = null, welcomeban
|
||||
text = text.replace('{ut}', member.user.discriminator);
|
||||
}
|
||||
|
||||
context.font = applyText(canvas, text);
|
||||
context.font= applyText(canvas, text);
|
||||
context.fillStyle = '#ffffff';
|
||||
context.fillText(text, (canvas.width/2) - (text.length * 7.5), canvas.height - 15);
|
||||
context.fillText(text, (canvas.width/2) - (context.measureText(text).width)/2, canvas.height - 15);
|
||||
|
||||
|
||||
//Draw a white circle
|
||||
|
||||
Reference in New Issue
Block a user