The Parent Object¶
-
class
Dev.
PythonManager
¶ Your main link to the chatbot. OBS controls are not documented
-
AddPoints
(userid, username, amount)¶ Adds points to the target user
- Parameters
userid (
str
) – the userid of the person you wish to add points to. On twitch this is generally the lowercase version of the username, but on mixer and youtube it will be something elseusername (
str
) – the username of the person you wish to add points to. this is not the same as the userid. it can be fetched usingGetDsiplayName()
amount (
int
) – the amount of points you wish to add
- Returns
bool
based on if the operation succeeded or not
-
RemovePoints
(userid, username, amount)¶ Removes points from the target user
- Parameters
userid –
str
the userid of the person you wish to remove points from. On twitch this is generally the lowercase version of the username, but on mixer and youtube it will be something elseusername –
str
the username of the person you wish to remove points from. this is not the same as the userid. it can be fetched usingGetDsiplayName()
amount –
int
the amount of points you wish to remove
- Returns
bool
based on if the operation succeeded or not
-
AddPointsAll
(data)¶ batch adds points to many users at once. blocks until the procedure is done
- Returns
Dict[
str
] a list of users that could not have points added to them
-
AddPointsAllAsync
(data, callback)¶ batch adds points to many users at once. returns immediately, and runs the callback when complete
Parameters
-
RemovePointsAll
(data)¶ batch removes points to many users at once. blocks until the procedure is done
- Returns
Dict[
str
] a list of users that could not have points removed from them
-
RemovePointsAllAsync
(data, callback)¶ batch removes points to many users at once. returns immediately, and runs the callback when complete
Parameters
-
GetPoints
(userid)¶ retrieves a users points
- Parameters
userid (
str
) – the userid of the user to get points for
- Returns
int
the points the user has
-
GetRank
(userid)¶ retrieves a users rank
- Parameters
userid (
str
) – the userid of the user to get rank for
- Returns
str
the rank the user has
-
GetHours
(userid)¶ retrieves a users hours
- Parameters
userid (
str
) – the userid of the user to get hours for
- Returns
float
the hours the user has watched for
-
GetTopCurrency
(n)¶ retrieves the top
n
users based on currency- Parameters
n (
int
) – the amount of users to get
- Returns
Dict[userid: points] a dict of userids to points.
-
GetTopHours
(n)¶ retrieves the top
n
users based on hour- Parameters
n (
int
) – the amount of users to get
- Returns
Dict[userid: points] a dict of userids to hours.
-
GetCurrencyUsers
(userids)¶ retrieves a list of
Currency
objects- Parameters
userids (
list
) – a list of userids
- Returns
a
list
ofCurrency
objects
-
SendStreamMessage(text):
sends a message to the stream chat
- Parameters
text (
str
) – the message to be sent
-
SendStreamWhisper
(userid, text)¶ sends a whisper to a viewer on stream
Important
this only works on twitch. it does not work on youtube or mixer
Warning
twitch whispers are very unreliable. Avoid using them if possible
-
SendDiscordMessage(text):
sends a message to the discord chat
Note
this only works if the streamer has set up discord
- Parameters
text (
str
) – the message to be sent
-
SendDiscordDM(userid, text):
sends a message to a specific discord user.
Note
this only works if the streamer has set up discord
-
BroadcastWSEvent
(event_name, json_data)¶ sends a message to connected overlays, should look something like
-
HasPermission
(userid, permission, info)¶ checks if a user has a certain permission. a list of permissions can be found Dev Permission Levels.
- Parameters
- Returns
-
GetViewerList
()¶ gets the current viewers
- Returns
list
of userids
-
GetActiveViewers
()¶ gets the current active chatters
- Returns
list
of userids
-
GetDisplayName
(userid)¶ gets a displayname based off the given userid
- Parameters
userid (
str
) – the userid to fetch a username for
-
AddCooldown
(script_name, command, seconds)¶ Adds a cooldown to the internal cooldown manager
-
IsOnCooldown
(script_name, command)¶ checks if a command is on cooldown
- Parameters
- Returns
-
GetCooldownDuration
(script_name, command)¶ fetches the remainder of the cooldown
- Parameters
- Returns
-
AddUserCooldown
(script_name, command, user, seconds)¶ Adds a user cooldown to the internal cooldown manager
-
IsOnUserCooldown
(script_name, command, user)¶ checks if a command is on user cooldown
- Parameters
- Returns
-
GetUserCooldownDuration
(script_name, command, user)¶ fetches the remainder of the cooldown for a user
- Parameters
- Returns
-
GetRequest
(url, headers)¶ GETs from an api
-
PostRequest
(url, headers, content, is_json=True)¶ POSTs to an api
-
DeleteRequest
(url, headers)¶ DELETEs from an api
-
PutRequest
(url, headers, content, is_json=True)¶ PUTs to an api
-
GetRandom
(min, max)¶ a replacement for the default random module, which is broken in ironpython. this can be fixed however, by doing the following
- Returns
-
GetChannelName
()¶ gets the channel name of the streamer.
Important
this only works on twitch
- Returns
-
Log
(script_name, message)¶ logs data to the chatbot’s logging window
-
PlaySound
(file_path, volume)¶ Attempts to play a sound, if possible, returns whether the sound was played or not
- Parameters
- Returns
-
GetQueue
(n)¶ Retrieves n number of people in the queue at the moment
- Parameters
n (
int
) – the amount of people to get
-
GetSongQueue
(max)¶ gets the next n songs in the song queue
- Parameters
n (
int
) – the amount of songs to get
- Returns
List[
Song
]
-
The Currency Object¶
The Song Object¶
Dev Permission Levels¶
These are passed to HasPermission
Permisssion |
Who is it |
---|---|
Caster |
The Streamer |
Editor |
A Chatbot editor |
Moderator |
A Stream moderator |
VIP+ |
A VIP or a subscriber |
VIP |
A VIP on stream |
Subscriber |
A subscriber on the platform |
Regular |
A Chatbot regular |