added .toggleimages
This commit is contained in:
parent
6a56a38f51
commit
1bc6f76395
|
@ -2,3 +2,4 @@ SOURCE_CHANNEL_ID_1=111111111111111111
|
|||
TARGET_CHANNEL_ID_1=111111111111111111
|
||||
DISCORD_TOKEN=mASJIUFHKWHG.18295790udqawihKS
|
||||
IMAGES=0
|
||||
COMMAND_CHANNEL_ID=28191298283975
|
||||
|
|
9
main.js
9
main.js
|
@ -10,7 +10,8 @@ const channelMappings = {
|
|||
[process.env.SOURCE_CHANNEL_ID_2]: process.env.TARGET_CHANNEL_ID_2,
|
||||
};
|
||||
|
||||
const includeImages = process.env.IMAGES === '1';
|
||||
let includeImages = process.env.IMAGES === '1';
|
||||
const COMMAND_CHANNEL_ID = process.env.COMMAND_CHANNEL_ID;
|
||||
|
||||
client.on('ready', () => {
|
||||
console.log(`${client.user.tag} is ready!`);
|
||||
|
@ -18,6 +19,12 @@ client.on('ready', () => {
|
|||
});
|
||||
|
||||
client.on('messageCreate', async message => {
|
||||
if (message.channel.id === COMMAND_CHANNEL_ID && message.content === '.toggleimages') {
|
||||
includeImages = !includeImages;
|
||||
return message.channel.send(`Image and link forwarding is now ${includeImages ? "enabled" : "disabled"}.`)
|
||||
.then(msg => setTimeout(() => msg.delete(), 5000));
|
||||
}
|
||||
|
||||
if (channelMappings[message.channel.id]) {
|
||||
if (message.author.id === client.user.id) return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue