Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

Commit

Permalink
v1.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
iwa authored May 17, 2020
2 parents 691b071 + 595a3a7 commit f7667bb
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 19 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Discord Bot for Qumu's Discord Server",
"main": "build/index.js",
"scripts": {
"update": "git fetch origin master && git pull origin master && tsc"
"update": "git fetch origin master && git pull origin master && rm -rf build/ && yarn && tsc"
},
"repository": {
"type": "git",
Expand All @@ -14,8 +14,8 @@
"license": "ISC",
"dependencies": {
"@discordjs/opus": "^0.3.2",
"@types/ejs": "^3.0.3",
"@types/mongodb": "^3.5.16",
"@types/ejs": "^3.0.4",
"@types/mongodb": "^3.5.17",
"@types/node": "^14.0.1",
"@types/puppeteer": "^2.1.0",
"@types/ws": "^7.2.4",
Expand Down
13 changes: 13 additions & 0 deletions src/commands/actions/hifive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Client, Message } from 'discord.js'
import { Db } from 'mongodb'
const highfive = require('./highfive');

module.exports.run = async (bot:Client, msg:Message, args:string[], db:Db) => {
highfive.run(bot, msg, args, db);
};

module.exports.help = {
name: 'hifive',
usage: "?hifive (mention someone)",
desc: "Highfive people by mentioning them. Requires the target to react back!\nAlias of ?highfive"
};
2 changes: 1 addition & 1 deletion src/commands/memes/sonicsays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports.run = async (bot:Client, msg:Message, args:string[]) => {
let cdnUrl = process.env.CDN_URL;

let html = await ejs.renderFile('views/sonicsays.ejs', { x, cdnUrl });
let file = await imGenerator(385, 209, html, msg.author.tag, 'sonic')
let file = await imGenerator(385, 209, html, msg.author.id, 'sonic')

try {
console.log(`info: sonicsays by ${msg.author.tag}`)
Expand Down
6 changes: 3 additions & 3 deletions src/commands/profile/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ async function profileImg(bot:Client, msg:Message, db:Db, id:string) {
let html, file;
if(id == process.env.QUMU) {
html = await ejs.renderFile('views/profileQumu.ejs', { user, colors, whichColor });
file = await imGenerator(508, 288, html, userDiscord.tag, 'prof')
file = await imGenerator(508, 288, html, userDiscord.id, 'prof')
} else if(id == bot.user.id) {
let thanksiwa:number = userDB.thanksiwa
html = await ejs.renderFile('views/profileBot.ejs', { user, colors, whichColor, thanksiwa });
file = await imGenerator(508, 358, html, userDiscord.tag, 'prof')
file = await imGenerator(508, 358, html, userDiscord.id, 'prof')
} else {
html = await ejs.renderFile('views/profile.ejs', { user, colors, whichColor });
file = await imGenerator(508, 428, html, userDiscord.tag, 'prof')
file = await imGenerator(508, 428, html, userDiscord.id, 'prof')
}

try {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/img.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default async function imGenerator(width:number, height:number, content:s
const page = await (await browser).newPage();
await page.setViewport({width: width, height: height, deviceScaleFactor: 2})
await page.setContent(content, {waitUntil: 'networkidle0'});
await page.screenshot({path: `image/${prefix}${tag}.jpg`, type: 'jpeg', quality: 100});
await page.screenshot({path: `image/${prefix}-${tag}.jpg`, type: 'jpeg', quality: 100});
await page.close();
return `image/${prefix}${tag}.jpg`
return `image/${prefix}-${tag}.jpg`
}
2 changes: 1 addition & 1 deletion src/utils/leveling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class leveling {
let cdnUrl = process.env.CDN_URL;

let html = await ejs.renderFile('views/level.ejs', { avatarURL, level, cdnUrl });
let file = await imGenerator(808, 208, html, msg.author.tag, 'lvl')
let file = await imGenerator(808, 208, html, msg.author.id, 'lvl')

try {
await msg.reply('', {files: [file]})
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class utilities {
"description": "Q-Bot is mainly developed and handled by <@125325519054045184>.\nYou can help contribute to Q-Bot's code [here!](https://github.com/iwa/Q-Bot)\n\nLanguage : `TypeScript` using NodeJS\nAPI Access : `discord.js` package on npm\n\nYou can access to the index of commands by typing `?help`\n\nAll my work is done for free, but you can still financially support me [here](https://www.patreon.com/iwaQwQ)",
"color": 13002714,
"footer": {
"text": "Created with ♥ by iwa & contributors | Copyright © iwa, v1.4.3"
"text": "Created with ♥ by iwa & contributors | Copyright © iwa, v1.4.4"
},
"thumbnail": {
"url": iwaUrl
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@
dependencies:
"@types/node" "*"

"@types/ejs@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@types/ejs/-/ejs-3.0.3.tgz#aa88c117fb4e666ece7348e8620d0c57b3cc2ad3"
integrity sha512-vkPNcai0FAHsaqLXObm1bTr87XOwfAS1a/jUx5b+Mj+lUToeEcgMIcdE0PuU0CdWq4VkNJYgLa0asYjrNb/maA==
"@types/ejs@^3.0.4":
version "3.0.4"
resolved "https://registry.yarnpkg.com/@types/ejs/-/ejs-3.0.4.tgz#8851fcdedb96e410fbb24f83b8be6763ef9afa77"
integrity sha512-ZxnwyBGO4KX/82AsFHTX82eMw0PsoBcIngEat+zx0y+3yxoNDJucAihg9nAcrc+g4Cwiv/4WcWsX4oiy0ySrRQ==

"@types/mongodb@^3.5.16":
version "3.5.16"
resolved "https://registry.yarnpkg.com/@types/mongodb/-/mongodb-3.5.16.tgz#b39b2e4873a5f399aa2a9027baeca542d0d76ebe"
integrity sha512-q12k9vFEGfQTUTC9KiN+Lf1nPpEawuPyTfIHBgGn+lSD/4ICZhePxQqEe/ukRgAjS63vdc+Td758VBr4bUGNjg==
"@types/mongodb@^3.5.17":
version "3.5.17"
resolved "https://registry.yarnpkg.com/@types/mongodb/-/mongodb-3.5.17.tgz#ada9f38076fb6182b23293af029afb83f4dc8c3d"
integrity sha512-pxpy5MIaEZ4Hmc8ijwVXCGYkWgs6w22whNwHmivbNi6NHWMxlR+QzIGeVGTCqfRcJKO6FuaJOYJ4vnYvz/VXAQ==
dependencies:
"@types/bson" "*"
"@types/node" "*"
Expand Down

0 comments on commit f7667bb

Please sign in to comment.