Refactor names for the UserAPI and the city handler.
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -17,7 +17,7 @@ class UserAPI:
|
||||
|
||||
status, json_data = await self.__fetcher.send_json(endpoint, {
|
||||
'username': username,
|
||||
'matrix_username': matrix_username,
|
||||
'matrixUsername': matrix_username,
|
||||
'phone': phone,
|
||||
})
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import nio
|
||||
import simplematrixbotlib as botlib
|
||||
|
||||
from src.handlers.help import help_handler
|
||||
from src.handlers.city import list_cities_handler, select_city_handler
|
||||
from src.handlers.city import city_list_handler, select_city_handler
|
||||
from src.handlers.user import register_handler
|
||||
|
||||
from src.fmt.city_formatter import CityFormatter
|
||||
@@ -18,11 +18,13 @@ def setup(bot: botlib.Bot, prefix: str):
|
||||
if not match.prefix():
|
||||
return
|
||||
|
||||
# No registered user required
|
||||
|
||||
if match.command('help'):
|
||||
await help_handler(bot=bot, room_id=room.room_id, sender=message.sender, admin_id=bot.config.admin_id)
|
||||
|
||||
if match.command('cities-list'):
|
||||
await list_cities_handler(bot=bot, room_id=room.room_id, sender=message.sender, admin_id=bot.config.admin_id)
|
||||
if match.command('city-list'):
|
||||
await city_list_handler(bot=bot, room_id=room.room_id, sender=message.sender, admin_id=bot.config.admin_id)
|
||||
|
||||
if match.command('select-city'):
|
||||
formatter = CityFormatter()
|
||||
|
||||
@@ -10,7 +10,7 @@ from src.fmt.city_formatter import CityFormatter
|
||||
|
||||
dots_bot_api_config = DotsBotApiConfig()
|
||||
|
||||
async def list_cities_handler(room_id: str, bot: botlib.Bot, sender: str, admin_id: str):
|
||||
async def city_list_handler(room_id: str, bot: botlib.Bot, sender: str, admin_id: str):
|
||||
|
||||
session = aiohttp.ClientSession(json_serialize=ujson.dumps)
|
||||
apiFetcher = ApiFetcher(dots_bot_api_config.get_base_url(), session)
|
||||
|
||||
Reference in New Issue
Block a user