-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e998e9
commit 026a0c4
Showing
5 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const Discord = require('discord.js'); | ||
var bot=new Discord.Client(); | ||
var HH=new Date().getHours(); | ||
var MM=new Date().getMinutes(); | ||
var i=0; | ||
var flag=0; | ||
const usr=require(__dirname+'/cred.json'); | ||
const key=require(__dirname+'/keywords.json'); | ||
bot.on("ready",async()=>{ | ||
console.log("\n\n\t ~ DiscordListener Online "); | ||
bot.user.setActivity(" with Myself"); | ||
}); | ||
bot.on('message',msg=>{ | ||
if(msg.content=='~on'){ | ||
if(msg.author.id==usr.uid){ | ||
msg.author.send("\n ~ Discord Listener Online "); | ||
flag=1; | ||
} | ||
} | ||
if(msg.content=='~off'){ | ||
if(msg.author.id==usr.uid){ | ||
msg.author.send("\n ~ Discord Listener Stopped "); | ||
flag=0; | ||
} | ||
} | ||
if(flag==1){ | ||
for(i=0;i<key.keys.length;i++){ | ||
if(msg.content.includes(key.keys[i])&&msg.channel.type!='dm'){ | ||
bot.users.get(usr.uid).send("[ "+msg.author.username+" ] : "+ msg.content); | ||
console.log("\n"); | ||
console.log(HH+":"+MM+" [ "+msg.author.username+" ] - " + msg.content ); | ||
} | ||
} | ||
} | ||
}); | ||
bot.login(usr.token); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@echo off | ||
COLOR 0A | ||
echo -- D I S C O R D L I S T E N E R -- | ||
echo B y A d B | ||
set tab= | ||
set /p uid=Enter USER ID : | ||
set /p token=Enter BOT Token : | ||
echo {>cred.json | ||
echo %tab%"token":"%token%",>>cred.json | ||
echo %tab%"uid":"%uid%">>cred.json | ||
echo }>>cred.json | ||
call npm init | ||
call npm install discord.js --save | ||
echo --- B O T I N I T I A L I Z A T I O N C O M P L E T E ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
echo -e "\t\t *** D i s c o r d L i s t e n e r B o t ***" | ||
echo -e "\t\t\t\t ~ B y A d B ~ " | ||
echo -e "\n\n" | ||
read -p " U S E R I D : " uid | ||
read -p " B O T T O K E N : " token | ||
chmod +x keys.sh | ||
FILENAME="cred.json" | ||
echo "{">$FILENAME | ||
echo -e "\t\"token\":\"$token\",">>$FILENAME | ||
echo -e "\t\"uid\":\"$uid\"">>$FILENAME | ||
echo "}">>$FILENAME | ||
npm init | ||
npm install discord.js --save | ||
echo -e " BOT INITIALIZATION COMPLETE " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@echo off | ||
COLOR 0A | ||
echo -- D i s c o r d L i s t e n e r B o t -- | ||
echo B y A d B | ||
echo | ||
echo | ||
echo -- E N T E R K E Y W O R D S -- | ||
set tab= | ||
echo {>keywords.json | ||
echo %tab%"keys": [ A0h@dcToBlk#, ">>keywords.json | ||
:while1 | ||
if %key% leq "END" ( | ||
set /p key=Enter Keyword : | ||
echo %key%>>keywords.json | ||
goto :while1 | ||
) | ||
endlocal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FILENAME="keywords.json" | ||
echo -e "\t\t ~ D i s c o r d L i s t e n e r B o t " | ||
echo -e "\t\t\t\t ~ B y A d B ~ " | ||
echo -e "\n\n --- E N T E R K E Y W O R D S --- " | ||
echo -e "\n\t Enter \" END \" when you are finished entering keywords \n\n" | ||
echo "{">$FILENAME | ||
echo -e -n "\t\"keys\": [ \"A0h@dcToBlk#\"">>$FILENAME | ||
while [ "$key" != "END" ] | ||
do | ||
read -p "Enter KEYWORD : " key | ||
echo -n ",\"$key\"">>$FILENAME | ||
done | ||
echo "]">>$FILENAME | ||
echo "}">>$FILENAME | ||
echo -e "\n\t K E Y W O R D S S A V E D \n\n " |