lmariscal / twitchirc

Twitch Bot Development made Easier | DEPRECATED
Other
39 stars 15 forks source link

Channel.getOwner() #3

Closed RoboSkyrat closed 9 years ago

RoboSkyrat commented 9 years ago

should implement the ability to get who the channel owner is. lets say i had the bot in my channel and wanted it to say my name no matter who issued the command. i want the ability to send it to a different channel and have it use their name instead of mine.

lmariscal commented 9 years ago

I don't understand you, can you make a longer explanation please.

RoboSkyrat commented 9 years ago

I want to be able to get the broadcaster from the channel the bot is in. Channel.getBroadcaster() would return a type User of the broadcaster.

lmariscal commented 9 years ago

Well when you receive a message/command theres a Channel object you can use the toString() method and substring it 1 and that would be the Channel owner

Example:

    @Override
    public void onMessage(User user, Channel channel, String message)
    {
        User owner = User.getUser(channel.toString().substring(1));
    }

But yeah, I can make a method so it gets easier.