Forwarded from Goddy BJS
Command - Any Command
var commands = [
{ command: "/start", description: "Restart Bot" },
{
command: "/mainmenu",
description: "Redirect to Menu"
}
]
HTTP.post({
url: "https://api.telegram.org/bot" + bot.token + "/setMyCommands",
body: {
commands: commands,
scope: { 'type': "default" }
},
headers: { "Content-type": "application/json" }
})
Bot.sendMessage("Done")Forwarded from Goddy BJS
Details- This code lists the group admins in a particular group
Bjs-
Command- /list
Command- /onAdminsReceived
Bjs-
Command- /list
Api.getChatAdministrators({
chat_id: chat.chatid,
on_result: "/onAdminsReceived"
});
Command- /onAdminsReceived
var admins = options.result;
var adminList = "Group Administrators:\n";
for (var i = 0; i < admins.length; i++) {
var admin = admins[i].user;
adminList += "โข " + admin.first_name;
if (admin.username) {
adminList += " (@" + admin.username + ")";
}
adminList += "\n";
}
Bot.sendMessage(adminList);
Forwarded from Goddy BJS
Name Detector Bjs
Command- *
Command- *
var userId = user.telegramid;
var currentName = user.first_name;
var storedName = Bot.getProperty("name_" + userId);
if (storedName && storedName !== currentName) {
Bot.sendMessage("๐ User " + userId + " has changed their name from '" + storedName + "' to '" + currentName + "'.");
Bot.setProperty("name_" + userId, currentName);
} else if (!storedName) {
Bot.setProperty("name_" + userId, currentName);
}
Forwarded from Goddy BJS
Command- Any Command
var telegramId = user.telegramid;
var firstName = user.first_name;
var lastName = user.last_name ? user.last_name : "N/A";
var username = user.username ? "@" + user.username : "N/A";
var languageCode = user.language_code ? user.language_code : "N/A";
var message = "๐ง *Your Telegram Account Information:*\n\n";
message += "๐ค *Telegram ID*: `" + telegramId + "`\n";
message += "๐ *First Name*: " + firstName + "\n";
message += "๐ *Last Name*: " + lastName + "\n";
message += "๐ฅ *Username*: " + username + "\n";
message += "๐ *Language*: " + languageCode + "\n";
Bot.sendMessage(message, { parse_mode: "Markdown" });
Forwarded from Goddy BJS
Goddy BJS
5 reactions for this codeโ๏ธ
Command - /time
Bjs-
Bjs-
var currentDate = new Date();
var day = currentDate.getDate();
var month = currentDate.getMonth() + 1; // Months are 0-indexed
var year = currentDate.getFullYear();
var weekday = currentDate.toLocaleString('en-US', { weekday: 'long' });
var hours = currentDate.getHours();
var minutes = currentDate.getMinutes();
var seconds = currentDate.getSeconds();
var milliseconds = currentDate.getMilliseconds();
var formattedDate = day + "/" + month + "/" + year;
var formattedTime = hours + ":" + (minutes < 10 ? "0" : "") + minutes + ":" + (seconds < 10 ? "0" : "") + seconds;
var timezone = "Asia/Kolkata"; // Example timezone, replace as needed
// Week number calculation
function getWeekNumber(date) {
var firstDayOfYear = new Date(date.getFullYear(), 0, 1);
var pastDaysOfYear = (date - firstDayOfYear) / 86400000;
return Math.ceil((pastDaysOfYear + firstDayOfYear.getDay() + 1) / 7);
}
var weekNumber = getWeekNumber(currentDate);
var message = "๐ *Full Date and Time Information:*\n";
message += "-----------------------------------\n";
message += "๐ *Day:* " + day + "\n";
message += "๐ *Month (Number):* " + month + "\n";
message += "๐ *Month (Name):* " + currentDate.toLocaleString('en-US', { month: 'long' }) + "\n";
message += "๐ *Year:* " + year + "\n";
message += "๐ *Day of the Week:* " + weekday + "\n";
message += "๐ *Week Number:* " + weekNumber + "\n";
message += "\n";
message += "โฐ *Time Information:*\n";
message += "-----------------------------------\n";
message += "๐ *Hours:* " + hours + "\n";
message += "๐ *Minutes:* " + minutes + "\n";
message += "๐ *Seconds:* " + seconds + "\n";
message += "๐ *Milliseconds:* " + milliseconds + "\n";
message += "\n";
message += "๐ *Formatted Date and Time:*\n";
message += "-----------------------------------\n";
message += "๐ *Formatted Date (dd/mm/yyyy):* " + formattedDate + "\n";
message += "๐ *Formatted Time (hh:mm:ss):* " + formattedTime + "\n";
message += "\n";
message += "๐ *Timezone:* " + timezone;
Api.sendMessage({
text: message,
parse_mode: "Markdown"
});
Forwarded from Goddy BJS
Chat information Bjs โ๏ธ
Command- /chatinfo
Bjs-
Command- /chatinfo
Bjs-
let chatTitle = chat.title;
let chatId = chat.id;
let chatType = chat.type;
let msg = "โน๏ธ *Chat Information:*\n\n" +
"๐น *Chat Name:* " + chatTitle + "\n" +
"๐น *Chat ID:* " + chatId + "\n" +
"๐น *Chat Type:* " + chatType + "\n";
if (chatType == "group" || chatType == "supergroup") {
msg += "๐น *Group Members Count:* Use /getgroupmembercount to see\n";
}
Api.sendMessage({
text: msg,
parse_mode: "Markdown"
});
Forwarded from Goddy BJS
Command- /getmembercount
Bjs-
Command- /next
Bjs-
Api.getChatMembersCount({
chat_id: chat.chatid,
on_result: "/next"
});
Command- /next
var membersCount = options.result;
Bot.sendMessage("This group has " + membersCount + " members.");
Forwarded from Goddy BJS
When we get to 500 subscribers I would give away this Anonymous chat bot๐โ๏ธ
Forwarded from Goddy BJS
1๏ธโฃCode to Hide Email/Number
Bjs-
For Number
For Email
Bjs-
For Number
let wallet = "138011457990";
let hide_wallet = "<b>Wallet:</b> " + wallet.substring(0, 3) + "โขโขโขโขโข" + wallet.substring(8, 10);
Bot.sendMessage(hide_wallet, { parse_mode: "html" });
For Email
let email = "goddybjsthebest@gmail.com";
let hide_email = "<b>Email:</b> " + email.substring(0, 4) + "โขโขโขโขโข" + email.substring(email.indexOf("@"));
Bot.sendMessage(hide_email, { parse_mode: "html" });
Forwarded from Goddy BJS
๐งช Get Forward Message Info From Channel.
๐ฐ Command:-
๐ Answer:-
โ Wait For Answer:- On
๐ BJS:-
๐ฐ Command:-
your command๐ Answer:-
*๐ฆ Forward Message From Channel.*โ Wait For Answer:- On
๐ BJS:-
if (request.forward_from_chat) {
var id = request.forward_from_chat.id.toString()
var uname = request.forward_from_chat.username
var title = request.forward_from_chat.title
var type = request.forward_from_chat.type
var msg_id = request.forward_from_message_id
if (request.forward_date) {
var ttmm = request.forward_date * 1000
} else {
var ttmm = request.date * 1000
}
var date_time = Libs.DateTimeFormat.format(
ttmm,
"dddd, dd/m/yyyy",
"Asia/Kolkata"
)
if (!uname || uname == null) {
var username = `๐ซ Not Set`
} else {
var username = "@" + uname
}
var uss =
"<a href='https://t.me/c/" + id.slice(4) + "/" + msg_id + "'>Check Now</a>"
var txt =if (request.forward_from_chat) {
var id = request.forward_from_chat.id.toString()
var uname = request.forward_from_chat.username
var title = request.forward_from_chat.title
var type = request.forw
Api.sendMessage({ text: txt, parse_mode: "html" })
} else {
Api.deleteMessage({ message_id: request.message_id })
}๐ Must Download Date/Time Libs.
โค๏ธโ๐ฅ Credit By:-
@AlgoRaushan
Forwarded from Goddy BJS
Goddy BJS
10 reactions for this bot๐โ๏ธ
I guess you guys donโt want this bot๐
Forwarded from Goddy BJS
Goddy BJS
5+ reactions for this codeโ๏ธ
Letโs get to 40 subscribers
Share to your friends โ๏ธ
Then I would drop the bjs
Share to your friends โ๏ธ
Then I would drop the bjs
Forwarded from Goddy BJS
Goddy BJS
5+ reactions for this codeโ๏ธ
Store on top any commmand e.g /start
Command- /bonus
Command- /setamount
Wait for answer- on
Command- /bonsuc
var allUsers = Bot.getProperty("allUsers", []);
if (allUsers.indexOf(user.telegramid) === -1) {
allUsers.push(user.telegramid);
Bot.setProperty("allUsers", allUsers, "json");
}
Command- /bonus
var adminId = 1399031414; // replace to your id
if (user.telegramid != adminId) {
Bot.sendMessage("โ You are not authorized to use this command.");
return;
}
Bot.sendMessage("Please enter the bonus amount to give per user:");
Bot.runCommand("/setamount");
Command- /setamount
Wait for answer- on
var adminId = 1399031414; // replace to your id
if (user.telegramid != adminId) {
Bot.sendMessage("โ You are not authorized to use this command.");
return;
}
var bonusAmount = parseFloat(message);
if (isNaN(bonusAmount) || bonusAmount <= 0) {
Bot.sendMessage("โ Please enter a valid bonus amount.");
return;
}
User.setProperty("bonusAmount", bonusAmount, "float");
Bot.sendMessage("โ Starting to distribute " + bonusAmount + " bonus to all users...");
Bot.runCommand("/bonsuc");
Command- /bonsuc
var bonusAmount = User.getProperty("bonusAmount");
if (!bonusAmount) {
Bot.sendMessage("โ Bonus amount not set.");
return;
}
var allUsers = Bot.getProperty("allUsers");
if (!allUsers || allUsers.length == 0) {
Bot.sendMessage("โ No users found.");
return;
}
for (var i = 0; i < allUsers.length; i++) {
var userId = allUsers[i];
var balance = Libs.ResourcesLib.anotherUserRes("balance", userId);
balance.add(bonusAmount);
Bot.sendMessageToChatWithId(userId, "๐ You have received a bonus of " + bonusAmount + " TRX!");
}
Bot.sendMessage("โ
Bonus has been successfully distributed to all users.");Forwarded from Goddy BJS
Forwarded message blocker for group chat
Command- * or @
Command- * or @
function handleIncomingMessage() {
let chatId = chat.chatid;
let messageId = request.message_id;
if (request.forward_date) {
let messageKey = "processed_message_" + chatId + "_" + messageId;
let processed = Bot.getProperty(messageKey);
if (processed) {
return;
}
Bot.setProperty(messageKey, true, "boolean");
Api.deleteMessage({
chat_id: chatId,
message_id: messageId
});
let username = user.username ? "@" + user.username : user.first_name;
Bot.sendMessage(username + ",Forwarded messages not allowed๐ก.");
return;
}
handleIncomingMessage();Forwarded from Goddy BJS
๐ซถ๐ปโค๏ธ AUTO REACTION (FOR CHANNEL) [Bots Business Codes].
๐ Command:
๐ BJS:
๐ Command:
*๐ BJS:
var request2 =JSON.parse(request)
if(request2.channel_post){
var msgid = request2.channel_post.message_id
var ch = request2.channel_post.sender_chat.id
var myEmoji = ["๐", "๐", "โค", "๐ฅ", "๐ฅฐ", "๐", "๐", "๐ค", "๐คฏ", "๐ฑ", "๐คฌ", "๐ข", "๐", "๐คฉ", "๐คฎ", "๐ฉ", "๐", "๐", "๐", "๐คก", "๐ฅฑ", "๐ฅด", "๐", "๐ณ", "โคโ๐ฅ", "๐", "๐ญ", "๐ฏ", "๐คฃ", "โก", "๐", "๐", "๐", "๐คจ", "๐", "๐", "๐พ", "๐", "๐", "๐", "๐ด", "๐ญ", "๐ค", "๐ป", "๐จโ๐ป", "๐", "๐", "๐", "๐", "๐จ", "๐ค", "โ", "๐ค", "๐ซก", "๐ ", "๐", "โ", "๐ ", "๐คช", "๐ฟ", "๐", "๐", "๐", "๐ฆ", "๐", "๐", "๐", "๐", "๐พ", "๐คทโโ", "๐คท", "๐คทโโ", "๐ก"]
var doEmoji = myEmoji[Math.floor(Math.random() * myEmoji.length)];
HTTP.post({
url: "https://api.telegram.org/bot" + bot.token + "/setMessageReaction",
body: {
chat_id: ch,
message_id: msgid,
reaction: JSON.stringify([
{
type: "emoji",
emoji: doEmoji,
is_big: true
}
])
}
});
}
๐ง๐ผโ๐ปCreated By: ๐ธ ๐ด ๐บ ๐ฒ ๐พ ๐ฆ