Skip to content

Commit 4dfcc9c

Browse files
Merge pull request #1 from TwitchLib/master
pull from main
2 parents 03c41f2 + e168fe0 commit 4dfcc9c

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ public class TwitchClientExample : MonoBehaviour
4646
// Update is called once per frame
4747
void Update()
4848
{
49-
_client.SendMessage("");
49+
//Don't call the client send message on every Update,
50+
//this is sample on how to call the client,
51+
//not an example on how to code.
52+
if(SomeConditionMet)
53+
{
54+
_client.SendMessage("");
55+
}
5056
}
5157

5258
}
@@ -74,14 +80,19 @@ public class TwitchApiExample : MonoBehaviour
7480
// Update is called once per frame
7581
void Update()
7682
{
77-
//Do what you want here, however if you want to call the twitch API this can be done as follows.
78-
//The following example is the GetChannelVideos if you want to call any TwitchLib.Api
79-
//endpoint replace the the following with your method call "_api.Channels.v5.GetChannelVideosAsync("{{CHANNEL_ID}}");"
80-
_api.Invoke(
81-
//Func<Task<ChannelVideos>>
82-
() => { return _api.Channels.v5.GetChannelVideosAsync("14900522"); },
83-
//Action<T>
84-
GetChannelVideosCallback);
83+
//Don't call the Api on every Update, this is sample on how to call the Api,
84+
//this is not an example on how to code.
85+
if(SomeConditionMet)
86+
{
87+
//Do what you want here, however if you want to call the twitch API this can be done as follows.
88+
//The following example is the GetChannelVideos if you want to call any TwitchLib.Api
89+
//endpoint replace the the following with your method call "_api.Channels.v5.GetChannelVideosAsync("{{CHANNEL_ID}}");"
90+
_api.Invoke(
91+
//Func<Task<ChannelVideos>>
92+
() => { return _api.Channels.v5.GetChannelVideosAsync("14900522"); },
93+
//Action<T>
94+
GetChannelVideosCallback);
95+
}
8596
}
8697

8798
private void GetChannelVideosCallback(TwitchLib.Api.Models.v5.Channels.ChannelVideos e)

0 commit comments

Comments
 (0)