mirror of
				https://github.com/keanuplayz/TravBot-v3.git
				synced 2024-08-15 02:33:12 +00:00 
			
		
		
		
	Moved poll command to fun category.
This commit is contained in:
		
							parent
							
								
									5b3df90067
								
							
						
					
					
						commit
						bd0984eb69
					
				
					 2 changed files with 28 additions and 1 deletions
				
			
		
							
								
								
									
										1
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							|  | @ -66,3 +66,4 @@ typings/ | ||||||
| .env | .env | ||||||
| 
 | 
 | ||||||
| config.json | config.json | ||||||
|  | .vscode/ | ||||||
							
								
								
									
										26
									
								
								src/commands/fun/poll.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/commands/fun/poll.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,26 @@ | ||||||
|  | import { MessageEmbed } from "discord.js"; | ||||||
|  | import Command from "../../core/command"; | ||||||
|  | import {CommonLibrary} from "../../core/lib"; | ||||||
|  | 
 | ||||||
|  | export default new Command({ | ||||||
|  | 	description: "Create a poll.", | ||||||
|  | 	usage: "<question>", | ||||||
|  | 	run: "Please provide a question.", | ||||||
|  | 	any: new Command({ | ||||||
|  | 		description: "Question for the poll.", | ||||||
|  | 		async run($: CommonLibrary): Promise<any> | ||||||
|  | 		{ | ||||||
|  | 			const embed = new MessageEmbed() | ||||||
|  | 				.setAuthor(`Poll created by ${$.message.author.username}`, $.message.guild?.iconURL({ dynamic: true }) ?? undefined) | ||||||
|  | 				.setColor(0xffffff) | ||||||
|  | 				.setFooter("React to vote.") | ||||||
|  | 				.setDescription($.args.join(" ")); | ||||||
|  | 			const msg = await $.channel.send(embed); | ||||||
|  | 			await msg.react("✅"); | ||||||
|  | 			await msg.react("⛔"); | ||||||
|  | 			$.message.delete({ | ||||||
|  | 				timeout: 1000 | ||||||
|  | 			}); | ||||||
|  | 		} | ||||||
|  | 	}) | ||||||
|  | }) | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue