-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathFollowerCheck.cs
More file actions
37 lines (29 loc) · 1.24 KB
/
FollowerCheck.cs
File metadata and controls
37 lines (29 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
public class CPHInline
{
public bool Execute()
{
// Get the user who triggered the command
string userName = CPH.GetUser();
string userId = CPH.GetUserId();
// Debug: Log the values
CPH.LogInfo($"Checking follower status for: {userName} (ID: {userId})");
// Check if user is a follower (correct method signature)
bool isFollower = CPH.TwitchIsUserFollowing(userId, CPH.TwitchGetBroadcastUserId());
// Debug: Log the result
CPH.LogInfo($"Is follower result: {isFollower}");
// Store the result in a variable that can be used by other actions
CPH.SetGlobalVar("isFollower", isFollower, false);
// If not a follower, send a message and stop execution
if (!isFollower)
{
CPH.SendMessage($"@{userName}, you must be a follower to use this command!");
CPH.LogInfo($"User {userName} blocked - not a follower");
return false; // Returning false stops the action queue
}
// Debug: Confirm follower status
CPH.SendMessage($"@{userName} is a verified follower. Command proceeding...");
CPH.LogInfo($"User {userName} verified as follower");
return true;
}
}