Esempio n. 1
0
        internal async Task JoinAsync(UserJoinedEventArgs args)
        {
            var data = _db.GetData(args.Guild);

            if (data.Configuration.Welcome.WelcomeMessage.IsNullOrEmpty())
            {
                return; //we don't want to send an empty join message
            }
            if (!data.Configuration.Welcome.WelcomeDmMessage.IsNullOrEmpty())
            {
                _ = await args.User.TrySendMessageAsync(data.Configuration.Welcome.FormatDmMessage(args.User));
            }

            _logger.Debug(LogSource.Volte,
                          "User joined a guild, let's check to see if we should send a welcome embed.");
            var welcomeMessage = data.Configuration.Welcome.FormatWelcomeMessage(args.User);
            var c = args.Guild.GetTextChannel(data.Configuration.Welcome.WelcomeChannel);

            if (!(c is null))
            {
                await new EmbedBuilder()
                .WithColor(data.Configuration.Welcome.WelcomeColor)
                .WithDescription(welcomeMessage)
                .WithThumbnailUrl(args.User.GetAvatarUrl())
                .WithCurrentTimestamp()
                .SendToAsync(c);

                _logger.Debug(LogSource.Volte, $"Sent a welcome embed to #{c.Name}.");
                return;
            }

            _logger.Debug(LogSource.Volte,
                          "WelcomeChannel config value resulted in an invalid/nonexistent channel; aborting.");
        }
Esempio n. 2
0
 void client_UserJoined(object sender, UserJoinedEventArgs e)
 {
     if (!(e.User.Equals(nick)))
     {
         if (elnotif)
         {
             cw.AddToChatWindow(6, e.User, " has joined the channel.");
         }
         addUserToList(e.User);
     }
 }
Esempio n. 3
0
 // Get the name of the user who joined the channel
 void OnUserJoined(UserJoinedEventArgs userJoinedArgs)
 {
     if (debugLogChannelMessages)
     {
         UnityEngine.Debug.Log("IpcIrcDebug: USER JOINED: " + userJoinedArgs.User);
     }
     if (debugEchoChannelMessages)
     {
         IpcIrc.Instance.Message("IpcIrcDebug: USER JOINED: " + userJoinedArgs.User);
     }
 }
Esempio n. 4
0
 // Get the name of the user who joined the channel
 void OnUserJoined(UserJoinedEventArgs userJoinedArgs)
 {
     if (debugLogChannelMessages)
     {
         UnityEngine.Debug.Log("IpcIrc: LordHelix:  WATCHED POKEMON JOIN: " + userJoinedArgs.User);
     }
     if (debugEchoChannelMessages)
     {
         IpcIrc.Instance.Message("IpcIrc:LordHelix:  WATCHED POKEMON JOIN: " + userJoinedArgs.User);
     }
     Debug.Log("IpcIrc:LordHelix: WATCHED USER JOIN: " + userJoinedArgs.User);
 }
Esempio n. 5
0
 // Get the name of the user who joined the channel
 void OnUserJoined(UserJoinedEventArgs userJoinedArgs)
 {
     if (debugLogChannelMessages)
     {
         UnityEngine.Debug.Log("IpcIrc: JohnConnor:  WATCHED TERMINATOR JOIN: " + userJoinedArgs.User);
     }
     if (debugEchoChannelMessages)
     {
         IpcIrc.Instance.Message("IpcIrc:JohnConnor:  WATCHED TERMINATOR JOIN: " + userJoinedArgs.User);
     }
     Debug.Log("IpcIrc:JohnConnor: WATCHED USER JOIN: " + userJoinedArgs.User);
 }
Esempio n. 6
0
        private async Task ApplyRoleAsync(UserJoinedEventArgs args)
        {
            var data       = _db.GetData(args.Guild);
            var targetRole = args.Guild.GetRole(data.Configuration.Autorole);

            if (targetRole is null)
            {
                _logger.Debug(LogSource.Volte,
                              $"Guild {args.Guild.Name}'s Autorole is set to an ID of a role that no longer exists; or is not set at all.");
                return;
            }

            await args.User.AddRoleAsync(targetRole);

            _logger.Debug(LogSource.Volte,
                          $"Applied role {targetRole.Name} to user {args.User} in guild {args.Guild.Name}.");
        }
Esempio n. 7
0
 private void Fire_UserJoined(UserJoinedEventArgs o)
 {
     op.Post(x => OnUserJoined(this, (UserJoinedEventArgs)x), o);
 }
Esempio n. 8
0
 //Get the name of the user who joined to channel
 void OnUserJoined(UserJoinedEventArgs userJoinedArgs)
 {
     //ChatText.text += "<b>" + "USER JOINED" + ":</b> " + userJoinedArgs.User + "\n";
     Debug.Log("USER JOINED: " + userJoinedArgs.User);
     //Users.Add(userJoinedArgs.User);
 }
Esempio n. 9
0
 void client_UserJoined(object sender, UserJoinedEventArgs e)
 {
     lstUsers.Items.Add(e.User);
 }
Esempio n. 10
0
 // Get the name of the user who joined the channel
 void OnUserJoined(UserJoinedEventArgs userJoinedArgs)
 {
     AppendAndScroll("<b>" + "USER JOINED" + ":</b> " + userJoinedArgs.User);
 }
Esempio n. 11
0
 private static void Client_UserJoined(object sender, UserJoinedEventArgs e)
 {
     Console.WriteLine($"{e.UserName} has joined {e.Channel}");
 }
Esempio n. 12
0
 private void Client_UserJoined(object sender, UserJoinedEventArgs e)
 {
 }
Esempio n. 13
0
 /// <summary>
 /// Capture and display if an user has joined the channel
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Client_UserJoined(object sender, UserJoinedEventArgs e)
 {
     this.Messages = this.Messages + "\n" + e.User + " has joined. ";
     this.ConnectionList.Add(e.User);
 }