mirror of
				https://gitlab.com/ceda_ei/Quadnite-Bot
				synced 2025-10-31 01:00:05 +01:00 
			
		
		
		
	Add base structure for bot. Rename questions.txt
This commit is contained in:
		
							
								
								
									
										21
									
								
								bot.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								bot.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| const Telegraf = require("telegraf"); | ||||
| const { BOT_API_KEY } = process.env; | ||||
| const fs = require("fs").promises; | ||||
| const commands = require("./commands"); | ||||
|  | ||||
| const bot = new Telegraf(BOT_API_KEY); | ||||
|  | ||||
| const data = [ | ||||
| 	"questions", | ||||
| 	"kys", | ||||
| 	"insults", | ||||
| 	"commands_list" | ||||
| ].map(file => | ||||
| 	fs.readFile(file + ".txt", "utf-8") | ||||
| 		.then(list => | ||||
| 			list.split("\n"))); | ||||
|  | ||||
| Promise.all(data) | ||||
| 	.then(data => | ||||
| 		commands(bot, data)); | ||||
|  | ||||
							
								
								
									
										1758
									
								
								questions.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1758
									
								
								questions.txt
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user