Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Database = require('st.db')
- const data = new Database({
- path:'data.json',
- crypto: {
- encrypt:false,
- }
- })
- client.on("message", message => {
- if(message.content.startsWith(prefix + "add-reply")){
- message.channel.send("اكتب الكلمه" )
- var filter = m => m.author.id == message.author.id;
- message.channel.awaitMessages(filter, {
- max: 1,
- time: 30000,
- errors: ['time'],
- }).then((collected) => {
- let word = collected.first().content
- message.channel.send("الرد")
- var filter = m => m.author.id == message.author.id;
- message.channel.awaitMessages(filter, {
- max: 1,
- time: 30000,
- errors: ['time'],
- }).then((collected) => {
- let reply = collected.first().content
- data.set({
- key : `reply_${message.guild.id}_${word.toLowerCase()}`,
- value : reply
- })
- message.channel.send("Done Set Word = " + word + " /And Reply = "+ reply)
- })
- })
- }
- })
- client.on("message", message => {
- if(data.has({key:`reply_${message.guild.id}_${message.content.toLowerCase()}`}) == true){
- message.channel.send(data.get({key:`reply_${message.guild.id}_${message.content.toLowerCase()}`}))
- }else return;
- })
- client.on("message", message => {
- if(message.content.startsWith(prefix + "delete-reply")){
- var args = message.content.split(" ").slice(1).join(" ")
- if(!args)return message.channel.send("الكلمه ال عايز تحذفها ")
- if(data.has({key:`reply_${message.guild.id}_${args.toLowerCase()}`}) == true){
- data.delete({key :`reply_${message.guild.id}_${args.toLowerCase()}` })
- message.channel.send("Done Delete Word")
- }else message.channel.send("I Can't Find This Word")
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement