Add configuration
This commit is contained in:
		
							parent
							
								
									3152ed000f
								
							
						
					
					
						commit
						a2f935c53e
					
				
							
								
								
									
										4
									
								
								config.example.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								config.example.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,4 @@ | ||||
| { | ||||
|     "token": "Token", | ||||
|     "ALLOWED_IDS": ["1266775948548903026", "1151129960141037659", "1275008490959667234", "1234866477086019648", "1277611369578889277", "1242022836529266708", "1275098630059200586", "1277311957405405296", "1277936618749300760", "1275899048171409528"] | ||||
| } | ||||
							
								
								
									
										8
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								index.js
									
									
									
									
									
								
							| @ -1,6 +1,7 @@ | ||||
| const { error } = require('console'); | ||||
| const { Client, Message, MessageAttachment } = require('discord.js-selfbot-v13'); | ||||
| const axios = require('axios'); | ||||
| const config = require('./config.json'); | ||||
| const client = new Client(); | ||||
| 
 | ||||
| client.on('ready', async () => { | ||||
| @ -11,8 +12,7 @@ let savedMessage; | ||||
| let count = 0; | ||||
| 
 | ||||
| function isAllowedUser(id) { | ||||
|     let ALLOWED_IDS = ["1266775948548903026", "1151129960141037659", "1275008490959667234", "1234866477086019648", "1277611369578889277", "1242022836529266708", "1275098630059200586", "1277311957405405296", "1277936618749300760", "1275899048171409528"]; | ||||
|     if (ALLOWED_IDS.find(string => string == id)) return true; | ||||
|     if (config.ALLOWED_IDS.find(string => string == id)) return true; | ||||
|     return false; | ||||
| } | ||||
| 
 | ||||
| @ -23,12 +23,14 @@ async function getMessageContent(message) { | ||||
| 
 | ||||
|             if (!attachment.url) { | ||||
|                 console.error('URL вложения не найден.'); | ||||
|                 return "Я нихуя не понял."; | ||||
|             } | ||||
| 
 | ||||
|             const response = await axios.get(attachment.url, { responseType: 'arraybuffer' }); | ||||
| 
 | ||||
|             if (!response.data) { | ||||
|                 console.error('Ошибка: response.data is undefined.'); | ||||
|                 return "Я нихуя не понял."; | ||||
|             } | ||||
| 
 | ||||
|             const buffer = Buffer.from(response.data, 'binary'); | ||||
| @ -68,4 +70,4 @@ client.on("messageCreate", async function(message){ | ||||
|     } | ||||
| }); | ||||
| 
 | ||||
| client.login('MTI3NDQ2ODg0NDc1NjUzMzM3NA.Gcnpxk.oWowhHvklMrBT1MfWWg_VbM6edb6HrerHAIhnI'); | ||||
| client.login(config.token); | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user