Upload case.js
Browse files
case.js
CHANGED
@@ -1035,6 +1035,10 @@ module.exports = async (conn, dev, chatUpdate, store) => {
|
|
1035 |
> ${sign} ${prefix}translate
|
1036 |
> ${sign} ${prefix}broadcast
|
1037 |
> ${sign} ${prefix}exchange
|
|
|
|
|
|
|
|
|
1038 |
> ββββββββββββββ
|
1039 |
|
1040 |
> βγ \`πππ
π ππππ\` γ
|
@@ -4917,8 +4921,75 @@ case 'members': {
|
|
4917 |
}
|
4918 |
break;
|
4919 |
}
|
|
|
|
|
4920 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4921 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4922 |
|
4923 |
|
4924 |
|
|
|
1035 |
> ${sign} ${prefix}translate
|
1036 |
> ${sign} ${prefix}broadcast
|
1037 |
> ${sign} ${prefix}exchange
|
1038 |
+
> ${sign} ${prefix}text2pdf
|
1039 |
+
> ${sign} ${prefix}autotyping
|
1040 |
+
> ${sign} ${prefix}alwaysonline
|
1041 |
+
> ${sign} ${prefix}antidelete
|
1042 |
> ββββββββββββββ
|
1043 |
|
1044 |
> βγ \`πππ
π ππππ\` γ
|
|
|
4921 |
}
|
4922 |
break;
|
4923 |
}
|
4924 |
+
case 'text2pdf': {
|
4925 |
+
if (!q) return reply(`\`No text detected\`\n*Example: ${prefix + command} text*`);
|
4926 |
|
4927 |
+
try {
|
4928 |
+
await loading();
|
4929 |
+
const apiUrl = `https://bk9.fun/tools/pdf?q=${encodeURIComponent(q)}`;
|
4930 |
+
const response = await fetch(apiUrl);
|
4931 |
+
if (!response.ok) throw new Error(`Failed to fetch PDF. Status: ${response.status}`);
|
4932 |
+
|
4933 |
+
const buffer = await response.buffer();
|
4934 |
+
await conn.sendMessage(m.chat, {
|
4935 |
+
document: buffer,
|
4936 |
+
mimetype: 'application/pdf',
|
4937 |
+
fileName: 'text2pdf.pdf',
|
4938 |
+
caption: fontx(`Here is your PDF file for the provided text.\n> ${caption}`)
|
4939 |
+
}, {
|
4940 |
+
quoted: m
|
4941 |
+
});
|
4942 |
+
|
4943 |
+
} catch (error) {
|
4944 |
+
console.error("Error in text2pdf case:", error);
|
4945 |
+
reply("An error occurred while converting the text to a PDF. Please try again later.");
|
4946 |
+
}
|
4947 |
+
break;
|
4948 |
+
}
|
4949 |
+
case 'autotyping': {
|
4950 |
+
if (!isOwner) return reply(mess.only.owner);
|
4951 |
+
|
4952 |
+
if (!args[0]) return reply(`Example: ${prefix + command} on/off`);
|
4953 |
+
if (args[0] === 'on') {
|
4954 |
+
global.autotyping = true;
|
4955 |
+
await reply('`Successfully Activated Autotyping.`');
|
4956 |
+
} else if (args[0] === 'off') {
|
4957 |
+
global.autotyping = false;
|
4958 |
+
await reply('`Successfully Deactivated Autotyping.`');
|
4959 |
+
} else {
|
4960 |
+
return reply(`\`Invalid option. Use "on" or "off" to toggle Anticall.\``);
|
4961 |
+
}
|
4962 |
+
break;
|
4963 |
+
}
|
4964 |
+
case 'antidelete': {
|
4965 |
+
if (!isOwner) return reply(mess.only.owner);
|
4966 |
+
if (!args[0]) return reply(`Example: ${prefix + command} on/off`);
|
4967 |
+
if (args[0] === 'on') {
|
4968 |
+
global.antidelete = true;
|
4969 |
+
await reply('`Successfully Activated Antidelete.`');
|
4970 |
+
} else if (args[0] === 'off') {
|
4971 |
+
global.antidelete = false;
|
4972 |
+
await reply('`Successfully Deactivated Antidelete.`');
|
4973 |
+
} else {
|
4974 |
+
return reply(`\`Invalid option. Use "on" or "off" to toggle Antidelete.\``);
|
4975 |
+
}
|
4976 |
+
break;
|
4977 |
+
}
|
4978 |
+
case 'alwaysonline': {
|
4979 |
+
if (!isOwner) return reply(mess.only.owner);
|
4980 |
+
if (!args[0]) return reply(`Example: ${prefix + command} on/off`);
|
4981 |
|
4982 |
+
if (args[0] === 'on') {
|
4983 |
+
global.alwaysonline = true;
|
4984 |
+
await reply('`Successfully Activated Alwaysonline.`');
|
4985 |
+
} else if (args[0] === 'off') {
|
4986 |
+
global.alwaysonline = false;
|
4987 |
+
await reply('`Successfully Deactivated Alwaysonline.`');
|
4988 |
+
} else {
|
4989 |
+
return reply(`\`Invalid option. Use "on" or "off" to toggle Alwaysonline.\``);
|
4990 |
+
}
|
4991 |
+
break;
|
4992 |
+
}
|
4993 |
|
4994 |
|
4995 |
|