mirror of
https://github.com/wah-su/stickerbridge.git
synced 2025-04-05 15:54:41 +00:00
chore: update access_token instructions (again)
This commit is contained in:
parent
6c89c6959f
commit
1ea058d80b
2 changed files with 4 additions and 16 deletions
|
@ -14,23 +14,17 @@ matrix_login_type: "access_token"
|
|||
|
||||
# If using "password", use this
|
||||
matrix_password: "password"
|
||||
matrix_bot_name: "Telegram stickers bot"
|
||||
|
||||
# If using "access_token", use this
|
||||
# How to get access_token if using synapse: https://t2bot.io/docs/access_tokens/
|
||||
# How to get access_token if using MAS, refer to this github issue:
|
||||
# https://github.com/etkecc/synapse-admin/issues/38
|
||||
# but omit the '--yes-i-want-to-grant-synapse-admin-privileges' flag
|
||||
# How to get access_token: https://t2bot.io/docs/access_tokens/
|
||||
matrix_token: "syn/mct_XXXXXXXXXXXXXXXXXX"
|
||||
|
||||
# IF Using MAS then device ID can be set as any string value
|
||||
# IF Using Synapse then device ID can be get with the following:
|
||||
# How to get Device ID:
|
||||
# How to get current session id:
|
||||
# 1. Click the "Sessions" tab (left side of the dialog).
|
||||
# 2. Click on the current session.
|
||||
# 3. Copy "Session ID" string
|
||||
matrix_deviceid: "Matrix-Telegram-Bot"
|
||||
matrix_deviceid: "A1sbDXXX"
|
||||
|
||||
command_prefix: "!sb"
|
||||
matrix_bot_name: "Telegram stickers bot"
|
||||
|
||||
log_level: INFO
|
||||
|
|
|
@ -37,14 +37,8 @@ async def main():
|
|||
client.add_event_callback(callbacks.autojoin_room, InviteMemberEvent)
|
||||
|
||||
if config['matrix_login_type'] == 'password':
|
||||
if not config['matrix_password']:
|
||||
logging.warning('Please fill in config.yaml file, then restart the bot')
|
||||
raise ValueError(f'No Password')
|
||||
login_response = await client.login(config['matrix_password'])
|
||||
elif config['matrix_login_type'] == 'access_token':
|
||||
if not config['matrix_token'] or not config['matrix_deviceid']:
|
||||
logging.warning('Please fill in config.yaml file, then restart the bot')
|
||||
raise ValueError(f'No access_token or Device ID')
|
||||
login_response = client.restore_login(config['matrix_username'], config['matrix_deviceid'], config['matrix_token'])
|
||||
else:
|
||||
raise ValueError(f'Unknown login type: "{config["matrix_login_type"]}" only "password" and "access_token" are supported')
|
||||
|
|
Loading…
Add table
Reference in a new issue