Esempio n. 1
0
    async def end_game(self, message: Message):
        loading_message = await message.channel.send(f'Ending game...')
        config = {}
        guild: Guild = message.guild
        State.save_config(guild.id, config)
        State.save_plugins(guild.id, [])
        await self.bot.save_guild_config(guild, config)

        player_role = State.get_player_role(guild.id)
        observer_role = State.get_observer_role(guild.id)
        for player in player_role.members:
            await player.remove_roles(player_role)
            await player.add_roles(observer_role)

        await message.channel.send(f'The game ends.')
        await loading_message.delete()
        await message.delete()

        await self.bot.refresh_from_config(guild, config)
Esempio n. 2
0
 async def mark_observer(self, message: Message, user: str):
     await self._mark_with_role(
         message, State.get_observer_role(message.guild.id), 'an observer'
     )