I am currently writing a Discord Bot in C#. I have most the bot done but for this next update I am wanting to add on the capability of checking if the Streamer has Gone live. Currently I am polling the Twitch API and Pulling the JSON File that it has and checking whether or not the JSON Stream Object is Null or Not. But this takes 3-5 min after the streamer to go live before it finally sees that Stream is not Null even though I poll the JSON every 5 seconds. Is there anyway to do this more efficiently? My code is Below:
Zack ArnettZack Arnett
1 Answer
Looks like it's intended behavior of Twitch API.They are definitely more focused on pushing their horsepower to streaming, not immediate data provision through API.
While there might be a limitation like this, you can try scrapping the page if timing is crucial and you don't want to wait 3-5 min for something that already happened.One idea is to poll page each 5s or so and then query the HTML document for something characteristic that distinguish offline and online channel.
For example, I have tried to query user pages (https://www.twitch.tv/username) in JavaScript with:
and for user that is not broadcasting it yields
true while for broadcasting user it yields false . Problem might be for user with no recent broadcasts history though.
You can try checking videos page (https://www.twitch.tv/username/videos/all) for their live indicator too like:
It will yield
true for streaming user and false for the one that does not stream (even if he/she is online).
Of course that's least efficient way on doing this and requires lots of download as compared to just polling but.. still it seems more up to date than asking API every 5s and still getting actual state delayed by 3-5min.
Just replicate querying like above in .NET and you're there.
You could also mix two approaches and if you see that someone started streaming, just disable page scrapping and swap to only API calls for checking if you're up-to-date still.
For parsing HTML documents use parsers like AngleSharp to do this in .NET: https://github.com/AngleSharp/AngleSharp
mwilczynskimwilczynski
2,43411 gold badge1212 silver badges2424 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged c#jsontwitchdiscorddiscord.net or ask your own question.
Streamlabs Chatbot can join your discord server to let your viewers know when you are live by automatically announce when your stream goes live. The bot can also answer to commands, run mini games and post timers in the discord if you so prefer.
Step 1: Setting up the application
Step 2: Finding Client ID Step 3: Paste the client id into the Chatbot and select server Step 4: Finding the Oauth Token Step 5: Inserting OAuth token Step 6: Input Bot Channel Step 7: Link Discord and Twitch Step 1: Setting up the application
Step 2: Finding Client ID
Step 3: Paste the client id into the Chatbot and select server
Step 4: Finding the Oauth Token
Step 5: Inserting OAuth token
Step 6: Input Bot Channel
Step 7: Link Discord and Twitch
The final step is something everyone who wants to use the bot in discord must do.
You can find the final step over HERE
Discord, a party- and voice-chat application, has taken the PC gaming sector by storm. Tens of millions of PC gamers use Discord to communicate and coordinate with each other, and the free service has quickly overshadowed fellow game-friendly chat apps such as TeamSpeak and Skype.
Discord enables gamers to communicate via microphone and text, create parties and groups, and even see what games their friends are playing. Previously, however, that last feature was limited to seeing what PC games friends were playing. Thanks to the Xbox One's new Discord integration, Discord users can now see what their friends are playing on Xbox One. As an added plus, setting Discord up on Xbox One is extremely simple.
1) Create a Discord Account. Step 1 is to create a Discord account. It is easy to do and free. Simply create a username, a password and include an email (a real one, as Discord will want to verify it). You can create a Discord account via the mobile app, desktop app or Discord’s website. 2) Link your accounts. On your Xbox One, select your gamer tag in the upper left-hand corner of your screen. Choose the Settings option, which is located under both the Home and System menus. From there, click on Account and select Linked social accounts, after which you'll be prompted to enter your account's passkey. Once you've done that, select the Discord tile to begin the account-linking process. 3) Use the Discord app. Via the Discord app on your phone or desktop, select the Settings option, which is represented by a gear icon. After tapping the gear, choose Connections and then Add. Once you have done that, select the Xbox logo that appears. 4) Enter your PIN. Once you've selected the Xbox logo on the Discord app, a PIN will appear on your Xbox One's TV screen. Enter it on the app. After it's entered, your accounts should be linked instantly.
La revolution francaise 1989 soundtrack. Overall Impressions
As neat as it is to have linked Xbox and Discord profiles, Xbox's Discord integration is severely limited, at least for now. Currently, from either the PC or mobile Discord app, the only functionality of this new cross-platform integration is that you can see what your friends are playing on Xbox One.
While this may be useful for coordinating play sessions with friends, it's a minor feature compared to what PC Discord users are used to. Specifically, the lack of cross-platform voice chat is a massive omission in Microsoft's attempt to integrate the PC platform's biggest chat service into the Xbox ecosystem. Without basic cross-platform voice chat, Discord parties or groups, the Xbox One's bare-bones Discord integration is nowhere near a must-have.
However, if you're an Xbox gamer and have a lot of friends who tend to play on PC, it might be worth the 5-minute setup time to link accounts and give your pals an easy way to see when you're gaming.
Discord’s Streamkit contains a lot of useful features for streamers. From integrating natively with Discord to creating custom overlays with OBS to adding bots, there’s a lot you can do to power up your community.
Turn on Integrations
The first thing you should do is connect your Twitch stream or YouTube channel to your Discord account. Open up the user settings and switch to the “Connections” category.
Using additional power (like a battery or other).The RFID Emulator developed here is designed with open software and hardware and is subject to dynamic progression in finding new ideas for lovers developers, whichever you may be too. How to copy rfid card.
After you’ve done that, head into your server settings and click the “Integrations” category. You’ll be greeted with settings to turn on. The following image shows the YouTube Sponsor integration, which gives your YouTube donators a special role in the Discord. Twitch has the same thing for subscribers.
Set Up the OBS Overlay
The OBS overlay provides a powerful way to connect your Discord chat to your stream. You can configure a widget that shows a real-time stream of the chat and then add that widget to OBS as a browser source. You could even add multiple channels and switch between them. There’s also a widget for displaying the server name and invite, as well as one for showing who’s talking.
Enable Streamer Mode
Streamer Mode isn’t too exciting, but it is useful. When enabled, this feature hides sensitive information about your account and hides server invites to prevent abuse. It also disables notifications, so they don’t show up on your stream. Once you enable it, Streamer Mode turns on automatically when you launch OBS and is built into Discord natively.
Go Beyond the Default Features by Connecting Bots
Outside of what Discord supports natively, there are lots more third-party integrations you can try out. With thousands of bots to choose from, there’s almost certainly one to suit your needs. Here are two we especially like.
Moderate Chats with Nightbot
If you’re a Twitch streamer, you might already use Nightbot. It’s a chat moderation and management bot for your Twitch (and YouTube) chat. Nightbot also has a Discord bot, which will connect the same bot that mods your chat to your Discord. You can use it to moderate chat there as well, but it also has a neat feature that syncs regular viewers of the stream to a Discord role.
Add Loads of Features with Muxy
Muxy is a Twitch extension and dashboard that boasts a ton of features, but their Discord bot connects all of it to your server. You can set up alerts for when you go live, display stats about the stream, and even post subscriber and donation messages in Discord.
You can download and configure all of this from the Streamkit home page. There also are numerous bots not featured on Streamkit that you can add to your server from the Discord Bot List page.
READ NEXT
![]()
(22 posts)
Pages:
zeogold
zeogold Sorry, data for given user is currently unavailable. Please, try again later. View profileView wishlistStart conversationInvite to friendsInvite to friendsAccept invitationAccept invitationPending invitation..User since {{ user.formattedDateUserJoined }} Friends since {{ user.formattedDateUserFriended }} Unblock chat User blocked This user's wishlist is not public.You can't chat with this user due to their or your privacy settings.You can't chat with this user because you have blocked him.You can't invite this user because you have blocked him.
From United States
zeogold: For the GOG demographic, it might become a WORSE deal.
Darvond: Elaborate? Allow me to summarize my entire argument in a lovely little syllogism for ya:1. If an integration between GOG and Discord would be largely profitable for both, both would be interested in it. 2. An integration between GOG and Discord would not be largely profitable for GOG. A. If a large number of GOG's users would be interested in an integration between GOG and Discord, an integration would be profitable. B. A large number of GOG's users would not be interested in an integration between GOG and Discord. C. An integration between GOG and Discord would not be largely profitable for GOG. 3. GOG is not interested in an integration between it and Discord. The reason for B is that, for one thing, there isn't very many multiplayer games on here which would require use of Discord or some other similar voicechat service. If you look into other threads (for example, currently, the 'Virtual Items' thread), you'll see why there's not many multiplayer games here: GOG's userbase doesn't want them, considering them to be DRM of a sort. For another thing, why is an integration even necessary? Why would you and the other person not just make a Discord account and use it separate from GOG? I use Discord and play a lot of multiplayer games with other users on here, and that's exactly what we do.
Darvond
Darvond Sorry, data for given user is currently unavailable. Please, try again later. View profileView wishlistStart conversationInvite to friendsInvite to friendsAccept invitationAccept invitationPending invitation..User since {{ user.formattedDateUserJoined }} Friends since {{ user.formattedDateUserFriended }} Unblock chat User blocked This user's wishlist is not public.You can't chat with this user due to their or your privacy settings.You can't chat with this user because you have blocked him.You can't invite this user because you have blocked him.
From United States
Darvond: Elaborate?
zeogold: The reason for B is that, for one thing, there isn't very many multiplayer games on here which would require use of Discord or some other similar voicechat service. If you look into other threads (for example, currently, the 'Virtual Items' thread), you'll see why there's not many multiplayer games here: GOG's userbase doesn't want them, considering them to be DRM of a sort.For another thing, why is an integration even necessary? Why would you and the other person not just make a Discord account and use it separate from GOG? I use Discord and play a lot of multiplayer games with other users on here, and that's exactly what we do. Networking. Just because we have the public forums doesn't mean organizing players is easy. We could have community servers with a public channel for users to discuss, ask questions, and generate ideas for things to do in!
zeogold
zeogold Sorry, data for given user is currently unavailable. Please, try again later. View profileView wishlistStart conversationInvite to friendsInvite to friendsAccept invitationAccept invitationPending invitation..User since {{ user.formattedDateUserJoined }} Friends since {{ user.formattedDateUserFriended }} Unblock chat User blocked This user's wishlist is not public.You can't chat with this user due to their or your privacy settings.You can't chat with this user because you have blocked him.You can't invite this user because you have blocked him.
From United States
Darvond: We could have community servers with a public channel for users to discuss, ask questions, and generate ideas for things to do in!
That's not a bad idea, but there's still no reason to connect it with GOG. Why don't you or some other user set up a channel and make a thread about it? Shouldn't be that hard to correlate the GOG and Discord accounts.Unless of course by 'connect', you mean that the thing would be officially run by GOG themselves, in which case I think they already do something like that with Twitch.
Darvond
Darvond Sorry, data for given user is currently unavailable. Please, try again later. View profileView wishlistStart conversationInvite to friendsInvite to friendsAccept invitationAccept invitationPending invitation..User since {{ user.formattedDateUserJoined }} Friends since {{ user.formattedDateUserFriended }} Unblock chat User blocked This user's wishlist is not public.You can't chat with this user due to their or your privacy settings.You can't chat with this user because you have blocked him.You can't invite this user because you have blocked him.
Discord Twitch Integration Not Working Video
From United States
Darvond: We could have community servers with a public channel for users to discuss, ask questions, and generate ideas for things to do in!
zeogold: That's not a bad idea, but there's still no reason to connect it with GOG. Why don't you or some other user set up a channel and make a thread about it? Shouldn't be that hard to correlate the GOG and Discord accounts.Unless of course by 'connect', you mean that the thing would be officially run by GOG themselves, in which case I think they already do something like that with Twitch. I meant connect as in the integration feature that Discord has with Youtube Gaming, Twitch, and other services.
zeogold
zeogold Sorry, data for given user is currently unavailable. Please, try again later. View profileView wishlistStart conversationInvite to friendsInvite to friendsAccept invitationAccept invitationPending invitation..User since {{ user.formattedDateUserJoined }} Friends since {{ user.formattedDateUserFriended }} Unblock chat User blocked This user's wishlist is not public.You can't chat with this user due to their or your privacy settings.You can't chat with this user because you have blocked him.You can't invite this user because you have blocked him.
From United States
zeogold: That's not a bad idea, but there's still no reason to connect it with GOG. Why don't you or some other user set up a channel and make a thread about it? Shouldn't be that hard to correlate the GOG and Discord accounts. Darvond: I meant connect as in the integration feature that Discord has with Youtube Gaming, Twitch, and other services. Didn't know it had that.Unless of course by 'connect', you mean that the thing would be officially run by GOG themselves, in which case I think they already do something like that with Twitch. In that case, you have to ask yourself how big those services are in comparison to GOG, and there's your answer.
skeletonbow
skeletonbow Sorry, data for given user is currently unavailable. Please, try again later. View profileView wishlistStart conversationInvite to friendsInvite to friendsAccept invitationAccept invitationPending invitation..User since {{ user.formattedDateUserJoined }} Friends since {{ user.formattedDateUserFriended }} Unblock chat User blocked This user's wishlist is not public.You can't chat with this user due to their or your privacy settings.You can't chat with this user because you have blocked him.You can't invite this user because you have blocked him.
From Canada
Darvond: Have neither party approached each other on the matter of integration?
What specific type of integration are you looking for? If you mean something like how you can attach Discord to your Steam/Facebook/Twitch/etc. accounts to access your contact lists and automatically add them to discord, keep track of online status and that sort of thing, it's really only a matter of GOG providing a public API for developers of 3rd party applications to be able to query the GOG platform for this information and then letting 3rd party application developers actually use it. The Galaxy API may already have this kind of information available, but official use of the Galaxy API is restricted only to partners so it's hard for people like this to really know what GOG's rules or processes are for accessing it as they have been notably private about it to date.
Discord Extension TwitchI think that one can safely presume that Discord has a big enough company behind it and that GOG is quite aware of them and their product because many GOG employees use it and it has shown up in photos taken at GOG etc. so it isn't an 'unknown, we don't know how many people use this' or anything like that. It's safe to assume GOG is well aware how widely used Discord is and what benefits people have from using it. What we don't know is whether Discord's company has officially contacted GOG to inquire about becoming a partner and gaining access to GOG's private Galaxy APIs, and that would be what has to happen in order for any form of integration between these two services to occur. Since GOG's APIs are both proprietary and non-public, we don't even know if they support the types of interfaces that would be necessary for Discord to have similar integration on GOG as it does with Steam/Twitch/and other platforms, but that would be a pre-requisite as well. The bigger question about such integration is not really so much about the GOG side other than knowing whether they have the infrastructure needed on their end and whether it is available to Discord to use, but rather the bigger question is whether or not the Discord company has interest themselves in adding support to integrate with GOG, and where such support might sit on their future feature priorities list. On the public forum side of things, we do not have the level of open engagement with GOG insiders to find out much about the GOG end of things at the moment I don't believe, however Discord itself has a public discord server where people can ask all kinds of questions, report bugs and other stuff, and I think they also have forums and a public bug report/feature request tracker, so one might contact the Discord developer community to ask them about whether they have considered adding GOG integration support similar to what is present for other gaming and social platforms, and where such a feature might sit on their priority list, and whether it is currently technically feasible (if such APIs actually exist). That's most likely where the answer to this will lay.
Darvond
Darvond Sorry, data for given user is currently unavailable. Please, try again later. View profileView wishlistStart conversationInvite to friendsInvite to friendsAccept invitationAccept invitationPending invitation..User since {{ user.formattedDateUserJoined }} Friends since {{ user.formattedDateUserFriended }} Unblock chat User blocked This user's wishlist is not public.You can't chat with this user due to their or your privacy settings.You can't chat with this user because you have blocked him.You can't invite this user because you have blocked him.
From United States
skeletonbow: -TECH-
..I uh, mostly maybe meant username display and maybe minor things like that.
Pages:
General discussion(22 posts)(22 posts)
(22 posts)
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |