mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 16:30:58 -05:00
Move stuff inside the for loop
This commit is contained in:
parent
c5101717e5
commit
fcfd11431a
@ -9,17 +9,16 @@ export default async(client:TClient)=>{
|
|||||||
let Data:any;
|
let Data:any;
|
||||||
const cacheExpiry:number = 7200; // Invalidate cache after sitting in Redis for 2 hours
|
const cacheExpiry:number = 7200; // Invalidate cache after sitting in Redis for 2 hours
|
||||||
|
|
||||||
|
const YTDB = await client.ytChannels.getChannels();
|
||||||
|
for (const channel of YTDB) {
|
||||||
let YTChannelID:string;
|
let YTChannelID:string;
|
||||||
let YTChannelName:string;
|
let YTChannelName:string;
|
||||||
let DiscordChannelID:string;
|
let DiscordChannelID:string;
|
||||||
let DiscordRoleID:string;
|
let DiscordRoleID:string;
|
||||||
|
|
||||||
const YTDB = await client.ytChannels.getChannels();
|
|
||||||
for (const channel of YTDB) {
|
|
||||||
YTChannelID = channel.dataValues.ytchannel;
|
YTChannelID = channel.dataValues.ytchannel;
|
||||||
DiscordChannelID = channel.dataValues.dcchannel;
|
DiscordChannelID = channel.dataValues.dcchannel;
|
||||||
DiscordRoleID = channel.dataValues.dcrole;
|
DiscordRoleID = channel.dataValues.dcrole;
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await Undici.request(`https://youtube.googleapis.com/youtube/v3/activities?part=snippet&channelId=${YTChannelID}&maxResults=2&key=${(await TSClient()).youtube}`, {
|
await Undici.request(`https://youtube.googleapis.com/youtube/v3/activities?part=snippet&channelId=${YTChannelID}&maxResults=2&key=${(await TSClient()).youtube}`, {
|
||||||
@ -47,4 +46,5 @@ export default async(client:TClient)=>{
|
|||||||
content: `${MessageTool.formatMention(DiscordRoleID, 'role')}\n**${YTChannelName}** just uploaded a video!\n${videoUrl}`, allowedMentions: {parse: ['roles']},
|
content: `${MessageTool.formatMention(DiscordRoleID, 'role')}\n**${YTChannelName}** just uploaded a video!\n${videoUrl}`, allowedMentions: {parse: ['roles']},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user