2021-04-11 09:11:21 +00:00
|
|
|
import {NamedCommand, RestCommand} from "../../core";
|
2021-04-07 06:43:39 +00:00
|
|
|
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-11 09:11:21 +00:00
|
|
|
async run({send, author, member}) {
|
2021-04-07 06:43:39 +00:00
|
|
|
const userID = author.id;
|
|
|
|
|
|
|
|
if (streamList.has(userID)) {
|
|
|
|
const stream = streamList.get(userID)!;
|
2021-04-10 19:08:36 +00:00
|
|
|
stream.description = "No description set.";
|
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: {
|
2021-04-10 19:08:36 +00:00
|
|
|
description: "No description set.",
|
2021-04-08 21:43:58 +00:00
|
|
|
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
|
|
|
}
|
2021-04-10 19:08:36 +00:00
|
|
|
},
|
|
|
|
any: new RestCommand({
|
2021-04-11 09:11:21 +00:00
|
|
|
async run({send, author, member, combined}) {
|
2021-04-10 19:08:36 +00:00
|
|
|
const userID = author.id;
|
|
|
|
|
|
|
|
if (streamList.has(userID)) {
|
|
|
|
const stream = streamList.get(userID)!;
|
|
|
|
stream.description = combined;
|
|
|
|
stream.update();
|
|
|
|
send(`Successfully set the stream description to:`, {
|
|
|
|
embed: {
|
|
|
|
description: stream.description,
|
|
|
|
color: member!.displayColor
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
// Alternatively, I could make descriptions last outside of just one stream.
|
|
|
|
send("You can only use this command when streaming.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2021-04-07 06:43:39 +00:00
|
|
|
});
|