Giter Club home page Giter Club logo

Comments (6)

Syzuna avatar Syzuna commented on June 16, 2024

I agree on that. I thought we changed them all already but semms like I was wrong

from twitchlib.client.

RRickkert avatar RRickkert commented on June 16, 2024

Looking at the extension method TimeoutUser, 1 of the methods already contains the possibility to provide a channel:
public static void TimeoutUser(this ITwitchClient client, string channel, string viewer, TimeSpan duration, string message = "", bool dryRun = false)

public static void TimeoutUser(this ITwitchClient client, JoinedChannel channel, string viewer, TimeSpan duration, string message = "", bool dryRun = false)

There is however, another method which doesn't require the channel as the first parameter:
public static void TimeoutUser(this ITwitchClient client, string viewer, TimeSpan duration, string message = "", bool dryRun = false)

Would you recommend removing the last method?

This also raises a question, why does the SendMessage method require a channel parameter? What was wrong with using an implementation as in the last TimeoutUser method? (Except for the fact that it doesn't provide any feedback if you're not connected to any channel)

from twitchlib.client.

swiftyspiffy avatar swiftyspiffy commented on June 16, 2024

I had forgotten I intentially added an override method that doesn't accept a channel, and instead sends the message using the first JoinedChannel object in the JoinedChannels list. This kind of method is kind of contrary to the direction we've gone in requiring channel, and I think it's probably good practice to have the programmer explicitely state which channel they're sending the message (or in this case, the time out to).

Thoughts @RRickkert @LuckyNoS7evin @Syzuna ?

from twitchlib.client.

Mahsaap avatar Mahsaap commented on June 16, 2024

Everything else is this way it would only make sense to continue

from twitchlib.client.

LuckyNoS7evin avatar LuckyNoS7evin commented on June 16, 2024

Agree, the reason we went down the specification of channel on every request was due to "hidden functionality with no warnings" for example this picked JoinedChannels[0] which threw an exception of there was no joined channel. It also caused issues for those that do join multiple channels as you could not guarantee what channel is in [0].

That's my two cents though

from twitchlib.client.

swiftyspiffy avatar swiftyspiffy commented on June 16, 2024

This has been fixed.

from twitchlib.client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.