re-formatting client_ID and client__Secret

This commit is contained in:
2025-11-18 01:37:17 +01:00
parent afa27271fa
commit 303c8430e8
2 changed files with 7 additions and 1 deletions

View File

@@ -1,13 +1,17 @@
import twitchio
class TwitchBot(twitchio.Client):
def __init__(self, access_token: str, channel_name: str, websocket_manager, db_user_id: int):
def __init__(self, access_token: str, client_id: str, client_secret: str, channel_name: str, websocket_manager, db_user_id: int):
self.websocket_manager = websocket_manager
# Store our application's database user ID to avoid conflict with twitchio's internal 'owner_id'
self.db_user_id = db_user_id
super().__init__(
token=access_token,
# The client_id and client_secret are required for the client to
# identify itself with Twitch's services.
client_id=client_id,
client_secret=client_secret,
initial_channels=[channel_name]
)
self.channel_name = channel_name

View File

@@ -32,6 +32,8 @@ class ListenerManager:
bot = TwitchBot(
access_token=access_token,
channel_name=user.username,
client_id=settings.TWITCH_CLIENT_ID,
client_secret=settings.TWITCH_CLIENT_SECRET,
websocket_manager=websocket_manager,
db_user_id=user.id
)