mirror of
				https://github.com/keanuplayz/TravBot-v3.git
				synced 2024-08-15 02:33:12 +00:00 
			
		
		
		
	Added nick command to admin.
This commit is contained in:
		
							parent
							
								
									facaf001ad
								
							
						
					
					
						commit
						979c00ddc8
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		|  | @ -105,6 +105,23 @@ export default new Command({ | ||||||
| 					})); | 					})); | ||||||
| 				await $.message.channel.bulkDelete(travMessages); | 				await $.message.channel.bulkDelete(travMessages); | ||||||
| 			} | 			} | ||||||
|  | 		}), | ||||||
|  | 		nick: new Command({ | ||||||
|  | 			description: "Change the bot's nickname.", | ||||||
|  | 			permission: Command.PERMISSIONS.BOT_SUPPORT, | ||||||
|  | 			async run($: CommonLibrary): Promise<any> | ||||||
|  | 			{ | ||||||
|  | 				try { | ||||||
|  | 					const nickName = $.args.join(" "); | ||||||
|  | 					const trav = $.guild?.members.cache.find(member => member.id === $.client.user?.id); | ||||||
|  | 					await trav?.setNickname(nickName); | ||||||
|  | 					$.message.delete({timeout: 5000}); | ||||||
|  | 					$.channel.send(`Nickname set to \`${nickName}\``) | ||||||
|  | 						.then(m => m.delete({timeout: 5000})); | ||||||
|  | 				} catch (e) { | ||||||
|  | 					console.log(e); | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
| 		}) | 		}) | ||||||
| 	} | 	} | ||||||
| }); | }); | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue