mirror of
https://github.com/liberliber/LINE-KickBot1.git
synced 2024-09-20 06:46:01 +08:00
Add files via upload
This commit is contained in:
parent
50325feebc
commit
87db2761ae
10
src/bot.js
10
src/bot.js
|
@ -1,7 +1,15 @@
|
|||
const LineConnect = require('./connect');
|
||||
let line = require('./main.js');
|
||||
let LINE = new line();
|
||||
|
||||
console.info("\n\
|
||||
$$\ $$\ $$$$$$\ $$\ $$\ $$\ $$\ $$$$$$\ \n\
|
||||
\$$\ $$ |$$ __$$\ $$ | $$ |$$$\ $$ |$$ __$$\ \n\
|
||||
\$$\ $$ / $$ / $$ |$$ | $$ |$$$$\ $$ |$$ / \__|\n\
|
||||
\$$$$ / $$ | $$ |$$ | $$ |$$ $$\$$ |$$ |$$$$\ \n\
|
||||
\$$ / $$ | $$ |$$ | $$ |$$ \$$$$ |$$ |\_$$ |\n\
|
||||
$$ | $$ | $$ |$$ | $$ |$$ |\$$$ |$$ | $$ |\n\
|
||||
$$ | $$$$$$ |\$$$$$$ |$$ | \$$ |\$$$$$$ |\n\
|
||||
\__| \______/ \______/ \__| \__| \______/ \n");
|
||||
|
||||
const auth = {
|
||||
authToken: '',
|
||||
|
|
|
@ -35,79 +35,17 @@ class Command extends LineAPI {
|
|||
|
||||
async getSpeed() {
|
||||
let curTime = Date.now() / 1000;
|
||||
await this._sendMessage(this.messages, '');
|
||||
const rtime = (Date.now() / 1000) - curTime;
|
||||
await this._sendMessage(this.messages, `${rtime} Second`);
|
||||
return;
|
||||
}
|
||||
|
||||
async cancelAll(gid) {
|
||||
let { listPendingInvite } = await this.searchGroup(gid);
|
||||
for (var i = 0; i < listPendingInvite.length; i++) {
|
||||
if(!this.isAdminOrBot(listPendingInvite[i].mid)){
|
||||
this._cancel(gid,listPendingInvite);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async youngSpamGroup(){
|
||||
var gname = this.messages.text.split(" ",2)[1];
|
||||
var uids = this.messages.text.replace("destruirlo "+gname+" ","").split(" ");
|
||||
while(uids.indexOf("") != -1){
|
||||
let i = uids.indexOf("");
|
||||
uids.splice(i,1);
|
||||
}
|
||||
for(let i = 0; i < 1000; i++){
|
||||
this._createGroup(gname,uids);
|
||||
}
|
||||
}
|
||||
|
||||
spamGroup() {
|
||||
if(this.isAdminOrBot(this.messages._from) && this.payload[0] !== 'kill') {
|
||||
let s = [];
|
||||
for (let i = 0; i < this.payload[1]; i++) {
|
||||
let name = `${Math.ceil(Math.random() * 1000)}${i}`;
|
||||
this.spamName.push(name);
|
||||
this._createGroup(name,[this.payload[0]]);
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (let z = 0; z < this.spamName.length; z++) {
|
||||
this.leftGroupByName(this.spamName[z]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
async recheck(cs,group) {
|
||||
let users;
|
||||
for (var i = 0; i < cs.length; i++) {
|
||||
if(cs[i].group == group) {
|
||||
users = cs[i].users;
|
||||
}
|
||||
}
|
||||
let contactMember = await this._getContacts(users);
|
||||
return contactMember.map((z) => {
|
||||
return { displayName: z.displayName, mid: z.mid };
|
||||
});
|
||||
}
|
||||
|
||||
async leftGroupByName(payload) {
|
||||
let groupID = await this._getGroupsJoined();
|
||||
for(var i = 0; i < groupID.length; i++){
|
||||
let groups = await this._getGroups(groupID);
|
||||
for(var ix = 0; ix < groups.length; ix++){
|
||||
if(groups[ix].name == payload){
|
||||
this._client.leaveGroup(0,groups[ix].id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async kickAll() {
|
||||
let groupID;
|
||||
if(this.stateStatus.kick == 1) {
|
||||
let updateGroup = await this._getGroup(this.messages.to);
|
||||
updateGroup.name = '𝔑𝔬 ℌ𝔢𝔞𝔡';
|
||||
updateGroup.name = 'Tobat Asu';
|
||||
await this._updateGroup(updateGroup);
|
||||
let msg = {
|
||||
text:null,
|
||||
|
@ -126,7 +64,7 @@ class Command extends LineAPI {
|
|||
}
|
||||
return;
|
||||
}
|
||||
return this._sendMessage(this.messages, '\n 𝔑𝔬ℌ𝔢𝔞𝔡 ᴄ/ᴏ ʏᴏᴜɴɢ\n ᴅᴇꜰɪɴɪɴɢ ʏᴏᴜʀ ᴀʀᴇᴀ\n ᴀꜱ ᴛʜᴇ ʏᴏᴜɴɢᴀʀᴇᴀ');
|
||||
return this._sendMessage(this.messages, 'Ndeleng sampeyan asu');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
14
src/main.js
14
src/main.js
|
@ -7,16 +7,15 @@ class LINE extends Command {
|
|||
this.receiverID = '';
|
||||
this.checkReader = [];
|
||||
this.stateStatus = {
|
||||
cancel: 1,
|
||||
cancel: 0,
|
||||
kick: 1,
|
||||
salam: 1
|
||||
};
|
||||
this.messages;
|
||||
this.payload
|
||||
}
|
||||
|
||||
get myBot() {
|
||||
const bot = ['u1d55aeaa8b863cb338f4e8fd7a761b4b','u1d55aeaa8b863cb338f4e8fd7a761b4b'];
|
||||
const bot = ['u1d55aeaa8b863cb338f4e8fd7a761b4b'];
|
||||
return bot;
|
||||
}
|
||||
|
||||
|
@ -47,10 +46,11 @@ class LINE extends Command {
|
|||
return this._acceptGroupInvitation(operation.param1);
|
||||
}
|
||||
}
|
||||
|
||||
if(operation.type == 16 && this.stateStatus.salam == 1){
|
||||
let halo = new Message();
|
||||
halo.to = operation.param1;
|
||||
halo.text = "opraken";
|
||||
halo.text = "kkabeh";
|
||||
this._client.sendMessage(0, halo);
|
||||
}
|
||||
this.getOprationType(operation);
|
||||
|
@ -81,11 +81,7 @@ class LINE extends Command {
|
|||
let sender = messages.from;
|
||||
|
||||
this.command('sp', this.getSpeed.bind(this));
|
||||
this.command(`opraken ${payload}`,this.kickAll.bind(this));
|
||||
this.command(`opraken ${payload}`,this.cancelAll.bind(this));
|
||||
this.command(`destruirlo ${payload}`,this.spamGroup.bind(this));
|
||||
this.command(`destruirlo ${payload}`,this.youngSpamGroup.bind(this));
|
||||
|
||||
this.command(`kkabeh ${payload}`,this.kickAll.bind(this));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue