forked from ChrisChrome/weather-bot
		
	Add a lil credits thing
This commit is contained in:
		
							parent
							
								
									0ba993b060
								
							
						
					
					
						commit
						042c5075d6
					
				| 
						 | 
					@ -2,7 +2,7 @@
 | 
				
			||||||
This is SUPER tossed together. Might bother cleaning it up later.
 | 
					This is SUPER tossed together. Might bother cleaning it up later.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## What is this?
 | 
					## What is this?
 | 
				
			||||||
This hooks up to the weather.im XMPP server and lets you push messages from iembot to a discord webhook and/or ntfy server topic.
 | 
					This is meant to be a public Discord bot. It connects via XMPP to Weather.IM and allows server owners to subscribe a channel to any number of weather alerts.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## How do I use this?
 | 
					## How do I use this?
 | 
				
			||||||
1. Clone the repo
 | 
					1. Clone the repo
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										36
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								index.js
									
									
									
									
									
								
							| 
						 | 
					@ -231,6 +231,10 @@ discord.on('ready', async () => {
 | 
				
			||||||
			"name": "list",
 | 
								"name": "list",
 | 
				
			||||||
			"description": "List all subscribed rooms for this channel",
 | 
								"description": "List all subscribed rooms for this channel",
 | 
				
			||||||
			"default_member_permissions": 0
 | 
								"default_member_permissions": 0
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								"name": "about",
 | 
				
			||||||
 | 
								"description": "About this bot"
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	];
 | 
						];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -320,6 +324,38 @@ discord.on("interactionCreate", async (interaction) => {
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					});
 | 
										});
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
 | 
									case "about":
 | 
				
			||||||
 | 
										// Send an embed showing info about the bot, including number of guilds, number of subscribed rooms, etc
 | 
				
			||||||
 | 
										let guilds = discord.guilds.cache.size;
 | 
				
			||||||
 | 
										let channels = 0;
 | 
				
			||||||
 | 
										await db.run(`SELECT COUNT(*) FROM channels`, (err, row) => {
 | 
				
			||||||
 | 
											if (err) {
 | 
				
			||||||
 | 
												console.error(err.message);
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
											channels = row[0];
 | 
				
			||||||
 | 
										});
 | 
				
			||||||
 | 
										const embed = {
 | 
				
			||||||
 | 
											title: "About Me!",
 | 
				
			||||||
 | 
											thumbnail: {
 | 
				
			||||||
 | 
												url: discord.user.avatarURL()
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											description: `I am a bot that listens to weather.im alerts and sends them to discord channels.\nI am open source, you can find my code [here!](https://github.com/ChrisChrome/iembot-2.0)`,
 | 
				
			||||||
 | 
											fields: [
 | 
				
			||||||
 | 
												{
 | 
				
			||||||
 | 
													name: "Guilds",
 | 
				
			||||||
 | 
													value: guilds
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												{
 | 
				
			||||||
 | 
													name: "Subscribed Rooms",
 | 
				
			||||||
 | 
													value: channels
 | 
				
			||||||
 | 
												}
 | 
				
			||||||
 | 
											]
 | 
				
			||||||
 | 
											color: 0x00ff00
 | 
				
			||||||
 | 
											footer: {
 | 
				
			||||||
 | 
												text: "Made by @chrischrome with <3",
 | 
				
			||||||
 | 
												icon_url: discord.users.cache.get("289884287765839882").avatarURL()
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue