Skip to content

[FAQ] set playing status

Housa Hitomi edited this page Nov 3, 2022 · 1 revision

TL;DR

    game = await bot.create_game('bar')
    await bot.update_playing_game(game)

furthur:

it's kinda ugly that creates a new game everytime updates playing status

to find current available game or create if unexists:

    games = await bot.list_game()
    game = next(filter(lambda g: g.name == 'bar', games), None)
    if game is None:
        game = await bot.create_game('bar')
    await bot.update_playing_game(game)