Skip to content

Commit

Permalink
chore: help
Browse files Browse the repository at this point in the history
  • Loading branch information
riskyprsty committed Mar 24, 2024
1 parent 1ec0d84 commit a759def
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 138 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"phin": "^3.7.0",
"pino": "^7.0.0",
"wa-sticker-formatter": "^4.4.4",
"winston": "^3.12.0",
"yt-search": "^2.10.4",
"ytdl-core": "^4.11.5"
}
Expand Down
123 changes: 1 addition & 122 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 6 additions & 14 deletions src/commands/help.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { IWebMessageInfoExtended } from '../lib/types.js';
import utils from '../lib/utils.js';
// import { getUrlInfo } from '@whiskeysockets/baileys';
//import { IWebMessageInfoExtended } from '../lib/types.js';
// import { sock } from '../index.js';

export async function helpCommand(senderNumber: string) {
export async function helpCommand(
senderNumber: string,
m: IWebMessageInfoExtended,
) {
const helpCmd = '*TRI-bot* - Staging version';
const prefix = '/';
const commandList = [
Expand All @@ -22,16 +23,7 @@ export async function helpCommand(senderNumber: string) {
'https://cdn.jsdelivr.net/gh/tribone23/tribot-ts@dev/src/assets/tribot.jpg';
const sourceurl = 'https://chat.whatsapp.com/EFMNbJdOL5UIY3aj4UXWVl';
const usage = `*Usage*\n[prefix](command)\n\n-- _Example_ --:\n\`\`\`${prefix}${commandList[2]}\`\`\`\n`;
const text = `Welcome, folks! 🔖\nWhat can i do for you today?\n\n${helpCmd}\n\n*Commands List*\n\`\`\`${commandList}\`\`\`\n\n${usage}\n\n\`\`\`Development by tribone23\`\`\`\n`;

// const linkPreview = await getUrlInfo('https://github.com', {
// thumbnailWidth: 1024,
// fetchOpts: {
// timeout: 5000,
// },
// uploadImage: sock.waUploadToServer,
// });
// console.log(linkPreview)
const text = `Hello, ${m.pushName}! 🔖\nWhat can i do for you today?\n\n${helpCmd}\n\n*Commands List*\n\`\`\`${commandList}\`\`\`\n\n${usage}\n\n\`\`\`Developed by tribone23\`\`\`\n`;

utils.sendLink(text, senderNumber, thumbnail, sourceurl);
}
2 changes: 1 addition & 1 deletion src/lib/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default async function (m: IWebMessageInfoExtended): Promise<void> {

switch (command) {
case 'help':
await helpCommand(senderNumber);
await helpCommand(senderNumber, m);
break;
case 'p':
console.log(m.args);
Expand Down

0 comments on commit a759def

Please sign in to comment.