@@ -50,7 +50,8 @@ export default class NetworkManager extends Factory {
5050 * @param message The network message to handle.
5151 */
5252 public async handleNetworkMessage ( message : NetworkMessage ) {
53- const locale = await message . client . getUserLocale ( message . author . id ) ;
53+ message . author . locale = await message . client . getUserLocale ( message . author . id ) ;
54+ const { locale } = message . author ;
5455
5556 const isNetworkMessage = await db . connectedList . findFirst ( {
5657 where : { channelId : message . channel . id , connected : true } ,
@@ -301,11 +302,19 @@ export default class NetworkManager extends Factory {
301302 * @param hubId - The ID of the hub the message is being sent in.
302303 * @returns A boolean indicating whether the message passed all checks.
303304 */
304- public async runChecks (
305- message : Message ,
306- settings : HubSettingsBitField ,
307- hubId : string ,
308- ) : Promise < boolean > {
305+ public async runChecks ( message : Message , settings : HubSettingsBitField , hubId : string ) {
306+ const sevenDaysAgo = Date . now ( ) - 1000 * 60 * 60 * 24 * 7 ;
307+ // if account is created within the last 7 days
308+ if ( message . author . createdTimestamp > sevenDaysAgo ) {
309+ await message . channel . send (
310+ t (
311+ { phrase : 'network.accountTooNew' , locale : message . author . locale } ,
312+ { user : `${ message . author } ` } ,
313+ ) ,
314+ ) ;
315+ return false ;
316+ }
317+
309318 const blacklistManager = this . client . getBlacklistManager ( ) ;
310319
311320 const isUserBlacklisted = await db . userData . findFirst ( {
0 commit comments