- Fix about command pfp
- Update sub/unsub command perms
This commit is contained in:
parent
dcf5518288
commit
04d3cb80e0
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
"name": "subscribe",
|
||||
"description": "Subscribe to a weather.im room",
|
||||
"default_member_permissions": 0,
|
||||
"default_member_permissions": 16,
|
||||
"options": [
|
||||
{
|
||||
"name": "room",
|
||||
|
@ -66,7 +66,7 @@
|
|||
{
|
||||
"name": "unsubscribe",
|
||||
"description": "Unsubscribe from a weather.im room",
|
||||
"default_member_permissions": 0,
|
||||
"default_member_permissions": 16,
|
||||
"options": [
|
||||
{
|
||||
"name": "room",
|
||||
|
@ -81,7 +81,7 @@
|
|||
{
|
||||
"name": "list",
|
||||
"description": "List all subscribed rooms for this channel",
|
||||
"default_member_permissions": 0
|
||||
"default_member_permissions": 16
|
||||
},
|
||||
{
|
||||
"name": "about",
|
||||
|
|
82
index.js
82
index.js
|
@ -687,7 +687,7 @@ discord.on('ready', async () => {
|
|||
await (async () => {
|
||||
try {
|
||||
//Global
|
||||
if(config.debug >= 1) console.log(`${colors.magenta("[DEBUG]")} Registering global commands: ${JSON.stringify(commands, null, 2)}`);
|
||||
if (config.debug >= 1) console.log(`${colors.magenta("[DEBUG]")} Registering global commands: ${JSON.stringify(commands, null, 2)}`);
|
||||
await rest.put(Routes.applicationCommands(discord.user.id), { body: commands })
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
@ -892,44 +892,46 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
await getUniqueChannels().then((unique) => {
|
||||
uniques = unique;
|
||||
});
|
||||
const embed = {
|
||||
title: "About Me!",
|
||||
thumbnail: {
|
||||
url: discord.user?.avatarURL()
|
||||
},
|
||||
description: `I listen to all the weather.im rooms and send them to discord channels.\nI am open source, you can find my code [here!](https://github.com/ChrisChrome/iembot-2.0)\n\nThis bot is not affiliated with NOAA, the National Weather Service, or the IEM project.`,
|
||||
fields: [
|
||||
{
|
||||
name: "Uptime",
|
||||
value: `Since <t:${Math.floor(startTimestap / 1000)}>, Started <t:${Math.floor(startTimestap / 1000)}:R>`,
|
||||
discord.users.fetch("289884287765839882").then((chrisUser) => {
|
||||
const embed = {
|
||||
title: "About Me!",
|
||||
thumbnail: {
|
||||
url: discord.user?.avatarURL()
|
||||
},
|
||||
{
|
||||
name: "Caught Messages",
|
||||
value: `Got ${messages.toLocaleString()} messages since startup`,
|
||||
},
|
||||
{
|
||||
name: "Guilds",
|
||||
value: guilds.toLocaleString(),
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: "Subscribed Rooms",
|
||||
value: channels.toLocaleString(),
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: "Unique Channels",
|
||||
value: uniques.toLocaleString(),
|
||||
inline: true
|
||||
description: `I listen to all the weather.im rooms and send them to discord channels.\nI am open source, you can find my code [here!](https://github.com/ChrisChrome/iembot-2.0)\n\nThis bot is not affiliated with NOAA, the National Weather Service, or the IEM project.`,
|
||||
fields: [
|
||||
{
|
||||
name: "Uptime",
|
||||
value: `Since <t:${Math.floor(startTimestap / 1000)}>, Started <t:${Math.floor(startTimestap / 1000)}:R>`,
|
||||
},
|
||||
{
|
||||
name: "Caught Messages",
|
||||
value: `Got ${messages.toLocaleString()} messages since startup`,
|
||||
},
|
||||
{
|
||||
name: "Guilds",
|
||||
value: guilds.toLocaleString(),
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: "Subscribed Rooms",
|
||||
value: channels.toLocaleString(),
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: "Unique Channels",
|
||||
value: uniques.toLocaleString(),
|
||||
inline: true
|
||||
}
|
||||
],
|
||||
color: 0x00ff00,
|
||||
footer: {
|
||||
text: "Made by @chrischrome with <3",
|
||||
icon_url: chrisUser.avatarURL()
|
||||
}
|
||||
],
|
||||
color: 0x00ff00,
|
||||
footer: {
|
||||
text: "Made by @chrischrome with <3",
|
||||
icon_url: "https://cdn.discordapp.com/avatars/289884287765839882/2b00063a92adfe08f325353eee29e348.webp?size=1024&format=webp&width=0&height=256"
|
||||
}
|
||||
}
|
||||
interaction.reply({ embeds: [embed] });
|
||||
interaction.reply({ embeds: [embed] });
|
||||
})
|
||||
});
|
||||
break;
|
||||
case "rooms":
|
||||
|
@ -1055,7 +1057,7 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
if (!channel) return interaction.reply({ content: "You need to be in a voice channel", ephemeral: true });
|
||||
// Join the channel and play the stream
|
||||
st = JoinChannel(channel, interactionUrl, .1, interaction);
|
||||
|
||||
|
||||
if (st) {
|
||||
interaction.reply({ content: "Joined, trying to start playing.", ephemeral: true });
|
||||
} else {
|
||||
|
@ -1065,7 +1067,7 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
|
||||
case "nwrplay": // Play NWR stream
|
||||
if (!interaction.inGuild()) return interaction.reply({ content: "This command can only be used in a guild", ephemeral: true });
|
||||
|
||||
|
||||
// Get the callsign
|
||||
const callsign = interaction.options.getString("callsign");
|
||||
// Get the URL associated with the callsign
|
||||
|
@ -1074,7 +1076,7 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
// Get the voice channel
|
||||
channel = interaction.member.voice?.channel; // Use a unique variable name
|
||||
if (!channel) return interaction.reply({ content: "You need to be in a voice channel", ephemeral: true });
|
||||
|
||||
|
||||
// Join the channel and play the stream
|
||||
const streamStatus = JoinChannel(channel, url, .1, interaction); // Use a unique variable name
|
||||
if (streamStatus) {
|
||||
|
@ -1083,7 +1085,7 @@ discord.on("interactionCreate", async (interaction) => {
|
|||
interaction.reply({ content: `Failed to play stream`, ephemeral: true });
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case "leave": // Leave Channel
|
||||
if (!interaction.inGuild()) return interaction.reply({ content: "This command can only be used in a guild", ephemeral: true });
|
||||
|
|
Loading…
Reference in a new issue