2021-04-07 06:43:39 +00:00
|
|
|
import {Command, NamedCommand} from "../../core";
|
|
|
|
import {streamList} from "../../modules/streamNotifications";
|
|
|
|
|
|
|
|
export default new NamedCommand({
|
|
|
|
description: "Sets the description of your stream. You can embed links by writing `[some name](some link)`",
|
2021-04-10 13:34:55 +00:00
|
|
|
async run({send, message, channel, guild, author, member, client, args}) {
|
2021-04-07 06:43:39 +00:00
|
|
|
const userID = author.id;
|
|
|
|
|
|
|
|
if (streamList.has(userID)) {
|
|
|
|
const stream = streamList.get(userID)!;
|
2021-04-08 21:43:58 +00:00
|
|
|
const description = args.join(" ") || "No description set.";
|
|
|
|
stream.description = description;
|
2021-04-07 06:43:39 +00:00
|
|
|
stream.update();
|
2021-04-10 13:34:55 +00:00
|
|
|
send(`Successfully set the stream description to:`, {
|
2021-04-08 21:43:58 +00:00
|
|
|
embed: {
|
|
|
|
description,
|
|
|
|
color: member!.displayColor
|
|
|
|
}
|
|
|
|
});
|
2021-04-07 06:43:39 +00:00
|
|
|
} else {
|
|
|
|
// Alternatively, I could make descriptions last outside of just one stream.
|
2021-04-10 13:34:55 +00:00
|
|
|
send("You can only use this command when streaming.");
|
2021-04-07 06:43:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|