All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pro.zackpollard.telegrambot.api.event.chat.ParticipantJoinGroupChatEvent Maven / Gradle / Ivy

There is a newer version: 1.6.5
Show newest version
package pro.zackpollard.telegrambot.api.event.chat;

import pro.zackpollard.telegrambot.api.chat.Chat;
import pro.zackpollard.telegrambot.api.chat.message.Message;
import pro.zackpollard.telegrambot.api.chat.message.content.NewChatParticipantContent;
import pro.zackpollard.telegrambot.api.event.chat.message.MessageEvent;
import pro.zackpollard.telegrambot.api.user.User;

/**
 * @author Zack Pollard
 */
public class ParticipantJoinGroupChatEvent extends MessageEvent {

    public ParticipantJoinGroupChatEvent(Message message) {
        super(message);
    }

    /**
     * Gets the User that joined the GroupChat that triggered this Event
     *
     * @return The User that joined the GroupChat that triggered this Event
     */
    public User getParticipant() {

        return ((NewChatParticipantContent) getMessage().getContent()).getContent();
    }

    /**
     * Gets the Chat that the User joined that triggered this Event
     *
     * @return The Chat that the User joined that triggered this Event
     */
    public Chat getChat() {

        return getMessage().getChat();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy