mirror of
				https://github.com/veganhacktivists/arabot.git
				synced 2025-11-04 04:19:49 +01:00 
			
		
		
		
	feat(verify): add welcome message after verify
This commit is contained in:
		
							parent
							
								
									9cc7e53ea9
								
							
						
					
					
						commit
						e0207fdd8d
					
				@ -26,6 +26,7 @@ import type {
 | 
			
		||||
  VoiceState,
 | 
			
		||||
  GuildMember,
 | 
			
		||||
  Guild,
 | 
			
		||||
  User,
 | 
			
		||||
} from 'discord.js';
 | 
			
		||||
import {
 | 
			
		||||
  ButtonInteraction,
 | 
			
		||||
@ -517,6 +518,8 @@ class VerificationJoinVCListener extends Listener {
 | 
			
		||||
          embeds: [embed],
 | 
			
		||||
          components: [],
 | 
			
		||||
        });
 | 
			
		||||
        // Send welcome message after verification
 | 
			
		||||
        await this.finishMessages(user.user, info.roles);
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
@ -618,6 +621,55 @@ class VerificationJoinVCListener extends Listener {
 | 
			
		||||
    }
 | 
			
		||||
    await user.roles.add(rolesAdd);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // Messages after verifying the user
 | 
			
		||||
  private async finishMessages(user: User, roles: {
 | 
			
		||||
    vegan: boolean,
 | 
			
		||||
    activist: boolean,
 | 
			
		||||
    trusted: boolean,
 | 
			
		||||
    vegCurious: boolean,
 | 
			
		||||
    convinced: boolean
 | 
			
		||||
  }) {
 | 
			
		||||
    // Not vegan
 | 
			
		||||
    if (!roles.vegan) {
 | 
			
		||||
      const general = this.container.client.channels.cache.get(IDs.channels.nonVegan.general) as TextChannel | undefined;
 | 
			
		||||
      if (general === undefined) {
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
      let msg = `${user}, you have been verified! Please check <#${IDs.channels.information.roles}> `
 | 
			
		||||
        + `and remember to follow the <#${IDs.channels.information.conduct}> and to respect ongoing discussion and debates.`;
 | 
			
		||||
      // Add extra info if the user got veg curious or convinced.
 | 
			
		||||
      if (roles.vegCurious || roles.convinced) {
 | 
			
		||||
        msg += `\n\nYou also have access to <#${IDs.channels.dietSupport.main}> for help on going vegan.`;
 | 
			
		||||
      }
 | 
			
		||||
      await general.send(msg);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Vegan
 | 
			
		||||
    const general = this.container.client.channels.cache.get(IDs.channels.vegan.general) as TextChannel | undefined;
 | 
			
		||||
    if (general === undefined) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    const msg = `Welcome ${user}! Please check out <#${IDs.channels.information.roles}> :)`;
 | 
			
		||||
    await general.send(msg);
 | 
			
		||||
 | 
			
		||||
    // Activist role
 | 
			
		||||
    if (roles.activist) {
 | 
			
		||||
      const activist = this.container.client.channels.cache.get(IDs.channels.activism.activism) as TextChannel | undefined;
 | 
			
		||||
      if (activist === undefined) {
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
      const activistMsg = `${user} you have been given the activist role! This means that if you'd wish to engage with non-vegans in `
 | 
			
		||||
        + `<#${IDs.channels.nonVegan.general}>, you should follow these rules:\n\n`
 | 
			
		||||
        + '1. Try to move conversations with non-vegans towards veganism/animal ethics\n'
 | 
			
		||||
        + '2. Don\'t discuss social topics while activism is happening\n'
 | 
			
		||||
        + '3. Have evidence for claims you make. "I don\'t know" is an acceptable answer. Chances are someone here knows or you can take time to find out\n'
 | 
			
		||||
        + '4. Don\'t advocate for baby steps towards veganism. Participation in exploitation can stop today\n'
 | 
			
		||||
        + '5. Differences in opinion between activists should be resolved in vegan spaces, not in the chat with non-vegans';
 | 
			
		||||
      await activist.send(activistMsg);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default VerificationJoinVCListener;
 | 
			
		||||
 | 
			
		||||
@ -59,15 +59,28 @@ const devIDs = {
 | 
			
		||||
  channels: {
 | 
			
		||||
    information: {
 | 
			
		||||
      news: '999431676058927247',
 | 
			
		||||
      conduct: '999431676058927248',
 | 
			
		||||
      roles: '999431676058927250',
 | 
			
		||||
    },
 | 
			
		||||
    staff: {
 | 
			
		||||
      coordinators: '999431676058927254',
 | 
			
		||||
      standup: '999431676289622183',
 | 
			
		||||
      verifiers: '999431677006860411',
 | 
			
		||||
    },
 | 
			
		||||
    dietSupport: {
 | 
			
		||||
      info: '999431677006860417',
 | 
			
		||||
      introduction: '999431677325615184',
 | 
			
		||||
      main: '999431677325615185',
 | 
			
		||||
    },
 | 
			
		||||
    nonVegan: {
 | 
			
		||||
      general: '999431677325615189',
 | 
			
		||||
    },
 | 
			
		||||
    vegan: {
 | 
			
		||||
      general: '999431677535338575',
 | 
			
		||||
    },
 | 
			
		||||
    activism: {
 | 
			
		||||
      activism: '999431678214807604',
 | 
			
		||||
    },
 | 
			
		||||
    diversity: {
 | 
			
		||||
      women: '999431679053660187',
 | 
			
		||||
      lgbtqia: '999431679053660188',
 | 
			
		||||
 | 
			
		||||
@ -62,15 +62,28 @@ let IDs = {
 | 
			
		||||
  channels: {
 | 
			
		||||
    information: {
 | 
			
		||||
      news: '866000393259319306',
 | 
			
		||||
      conduct: '990728521531920385',
 | 
			
		||||
      roles: '990761562199457813',
 | 
			
		||||
    },
 | 
			
		||||
    staff: {
 | 
			
		||||
      coordinators: '1006240682505142354',
 | 
			
		||||
      standup: '996009201237233684',
 | 
			
		||||
      verifiers: '873215538627756072',
 | 
			
		||||
    },
 | 
			
		||||
    dietSupport: {
 | 
			
		||||
      info: '993891104346873888',
 | 
			
		||||
      introduction: '993272252743286874',
 | 
			
		||||
      main: '822665615612837918',
 | 
			
		||||
    },
 | 
			
		||||
    nonVegan: {
 | 
			
		||||
      general: '798967615636504657',
 | 
			
		||||
    },
 | 
			
		||||
    vegan: {
 | 
			
		||||
      general: '787738272616808509',
 | 
			
		||||
    },
 | 
			
		||||
    activism: {
 | 
			
		||||
      activism: '730907954877956179',
 | 
			
		||||
    },
 | 
			
		||||
    diversity: {
 | 
			
		||||
      women: '938808963544285324',
 | 
			
		||||
      lgbtqia: '956224226556272670',
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user